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."%("--"iftensor._baseisNoneelsetensor._base.shape,new_data_tensor.shape))
tensor.data=new_data_tensor
tensor.data=new_data_tensor
...
@@ -305,19 +336,9 @@ class CheckpointFunction(torch.autograd.Function):
...
@@ -305,19 +336,9 @@ class CheckpointFunction(torch.autograd.Function):