MCPcopy
hub / github.com/tinygrad/tinygrad / contiguous

Method contiguous

tinygrad/uop/ops.py:568–572  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

566 return UOp(Ops.REDUCE, kwargs.pop('dtype', self.dtype), src=(self,)+src, arg=arg, **kwargs)
567
568 def contiguous(self, *args, **kwargs):
569 if self.op is Ops.CONTIGUOUS: return self
570 if self.device is None: return self
571 if self.has_buffer_identity(): return self
572 return UOp(Ops.CONTIGUOUS, dtype=self.dtype, src=(self,)+args, **kwargs)
573 def bufferize(self, *args, **kwargs): return UOp(Ops.STAGE, dtype=self.dtype, src=(self,)+args, **kwargs)
574 def allreduce(self, op, device:str|tuple[str, ...]|UOp):
575 assert isinstance(self.device, tuple), f"allreduce must be on tuple {self.device} isn't"

Callers 15

contiguous_mops_to_viewFunction · 0.45
callify.pyFile · 0.45
gradient.pyFile · 0.45
ggml_data_to_tensorFunction · 0.45
precompute_freqs_cisFunction · 0.45
__call__Method · 0.45
_feed_forwardMethod · 0.45
_runMethod · 0.45
__call__Method · 0.45
from_ggufMethod · 0.45

Calls 2

has_buffer_identityMethod · 0.95
UOpClass · 0.85

Tested by 15

test_plus_bigMethod · 0.36
test_catMethod · 0.36
test_sumMethod · 0.36
test_gemmMethod · 0.36
test_gemvMethod · 0.36
test_symbolicMethod · 0.36
test_symbolic_reduceMethod · 0.36
test_mnistMethod · 0.36
test_mnist_backwardMethod · 0.36
test_schedule_gcMethod · 0.36