MCPcopy Create free account
hub / github.com/Vegetebird/GraphMLP / get_varialbe

Function get_varialbe

common/utils.py:25–36  ·  view source on GitHub ↗
(split, target)

Source from the content-addressed store, hash-verified

23
24
25def get_varialbe(split, target):
26 num = len(target)
27 var = []
28 if split == 'train':
29 for i in range(num):
30 temp = Variable(target[i], requires_grad=False).contiguous().type(torch.cuda.FloatTensor)
31 var.append(temp)
32 else:
33 for i in range(num):
34 temp = Variable(target[i]).contiguous().cuda().type(torch.cuda.FloatTensor)
35 var.append(temp)
36 return var
37
38
39def print_error(data_type, action_error_sum, is_train):

Callers 2

trainFunction · 0.85
testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected