MCPcopy Create free account
hub / github.com/JMoonr/LATR / to_python_float

Function to_python_float

experiments/ddp.py:89–93  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

87 random.seed(args.proc_id)
88
89def to_python_float(t):
90 if hasattr(t, 'item'):
91 return t.item()
92 else:
93 return t[0]
94
95def reduce_tensor(tensor, world_size):
96 rt = tensor.clone()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected