if type(value) == torch.autograd.variable.Variable:
value = value.data
if torch.is_tensor(value):
if value.dim() != 1 or value.size(0) != 1:
continue
else:
value = value[0]
if type(value) == list:
After Change
if torch.is_tensor(value):
if value.dim() == 0:
//value = value.detach() // not tracked by autograd anymore
value = value.item() // get number from a torch scalar
else:
continue
if type(value) == list: