MCPcopy Create free account
hub / github.com/DIVE128/DMVSNet / tensor2numpy

Function tensor2numpy

tools.py:109–115  ·  view source on GitHub ↗
(vars)

Source from the content-addressed store, hash-verified

107
108@make_recursive_func
109def tensor2numpy(vars):
110 if isinstance(vars, np.ndarray):
111 return vars
112 elif isinstance(vars, torch.Tensor):
113 return vars.detach().cpu().numpy().copy()
114 else:
115 raise NotImplementedError("invalid input type {} for tensor2numpy".format(type(vars)))
116
117
118@make_recursive_func

Callers 4

save_imagesFunction · 0.85
train_epochMethod · 0.85
validateMethod · 0.85
testMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected