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))
assert_viewless_tensor(
tensor,
extra_msg="FYI, tensor._base has shape %s, and new_data_tensor has shape %s."