MCPcopy Index your code
hub / github.com/twitter/the-algorithm-ml / batch_size

Method batch_size

common/batch.py:42–49  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

40
41 @property
42 def batch_size(self) -> int:
43 for tensor in self.as_dict().values():
44 if tensor is None:
45 continue
46 if not isinstance(tensor, torch.Tensor):
47 continue
48 return tensor.shape[0]
49 raise Exception("Could not determine batch size from tensors.")
50
51
52@dataclass

Callers

nothing calls this directly

Calls 1

as_dictMethod · 0.95

Tested by

no test coverage detected