MCPcopy Create free account
hub / github.com/apple/ml-pointersect / get_shape

Method get_shape

cdslib/core/data/chunked_memmap.py:181–187  ·  view source on GitHub ↗

Returns the shape of idx-th sample.

(self, idx: int)

Source from the content-addressed store, hash-verified

179 return np.array(arr)
180
181 def get_shape(self, idx: int) -> T.Sequence[int]:
182 """Returns the shape of idx-th sample."""
183 # get chunk idx of ith sample
184 target_chunk_idx = self.chunk_idxs[idx]
185 # get sample shape
186 sample_shape = self.chunk_sample_shapes_dict[target_chunk_idx][self.chunk_local_idxs[idx]]
187 return sample_shape
188
189 def add_all_samples(
190 self,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected