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

Function tocuda

tools.py:150–156  ·  view source on GitHub ↗
(vars)

Source from the content-addressed store, hash-verified

148
149@make_recursive_func
150def tocuda(vars):
151 if isinstance(vars, torch.Tensor):
152 return vars.to(torch.device("cuda"))
153 elif isinstance(vars, str):
154 return vars
155 else:
156 raise NotImplementedError("invalid input type {} for tensor2numpy".format(type(vars)))
157
158
159# a wrapper to compute metrics for each image individually

Callers 3

train_epochMethod · 0.70
validateMethod · 0.70
testMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected