MCPcopy Create free account
hub / github.com/togethercomputer/OpenChatKit / _assert_contiguous

Function _assert_contiguous

training/data_parallel/flatten_utils.py:4–9  ·  view source on GitHub ↗
(tensors)

Source from the content-addressed store, hash-verified

2
3
4def _assert_contiguous(tensors):
5 data_ptr = None
6 for t in tensors:
7 if data_ptr is not None:
8 assert t.data_ptr() == data_ptr
9 data_ptr = t.data_ptr() + t.numel() * t.element_size()
10
11
12def flatten_params(param_set, chunk=None):

Callers 1

flatten_paramsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected