MCPcopy Create free account
hub / github.com/AdaptiveMotorControlLab/FMPose3D / get_variable

Function get_variable

fmpose3d/common/utils.py:226–239  ·  view source on GitHub ↗
(split, target)

Source from the content-addressed store, hash-verified

224
225
226def get_variable(split, target):
227 device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
228 num = len(target)
229 var = []
230 if split == "train":
231 for i in range(num):
232 temp = target[i].requires_grad_(False).contiguous().float().to(device)
233 var.append(temp)
234 else:
235 for i in range(num):
236 temp = target[i].contiguous().float().to(device)
237 var.append(temp)
238
239 return var
240
241
242def print_error(data_type, action_error_sum, is_train):

Callers 2

test_multi_hypothesisFunction · 0.50
trainFunction · 0.50

Calls

no outgoing calls

Tested by 1

test_multi_hypothesisFunction · 0.40