The files in this folder are ported from [Megatron-LM](https://github.com/NVIDIA/Megatron-LM/tree/main/megatron/core). We only keep the codes that are used in inference.
Check first that the tensor is viewless (i.e., '._base' not set). If not,
raise an exception.
'''
assert_viewless_tensor(tensor,extra_msg="FYI, tensor._base has shape %s, and new_data_tensor has shape %s."%("--"iftensor._baseisNoneelsetensor._base.shape,new_data_tensor.shape))