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

Function tensor2float

tools.py:119–125  ·  view source on GitHub ↗
(vars)

Source from the content-addressed store, hash-verified

117
118@make_recursive_func
119def tensor2float(vars):
120 if isinstance(vars, float):
121 return vars
122 elif isinstance(vars, torch.Tensor):
123 return vars.data.item()
124 else:
125 raise NotImplementedError("invalid input type {} for tensor2float".format(type(vars)))
126
127
128def reduce_scalar_outputs(scalar_outputs):

Callers 3

save_scalarsFunction · 0.85
train_epochMethod · 0.85
validateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected