megatron.core.utils.make_viewless_tensor#

megatron.core.utils.make_viewless_tensor(inp, requires_grad, keep_graph)#

Entry-point for creating viewless tensors.

This method should be used, rather than calling ‘MakeViewlessTensor’ or ‘_kernel_make_viewless_tensor’ directly. This method acts as a switch for determining if an autograd function or a regular method should be used to create the tensor.