MCPcopy
hub / github.com/tinygrad/tinygrad / index

Method index

tinygrad/uop/ops.py:462–463  ·  view source on GitHub ↗
(self, *srcs:UOp|None, ptr=False, **kwargs)

Source from the content-addressed store, hash-verified

460 def vectorize(self, *srcs):
461 return UOp(Ops.STACK, self.dtype.vec(len(srcs)+1), (self,)+srcs)
462 def index(self, *srcs:UOp|None, ptr=False, **kwargs):
463 return UOp(Ops.INDEX, kwargs.pop("dtype", self.dtype if ptr else self.dtype.base), (self,)+tuple([x for x in srcs if x is not None]), **kwargs)
464 def __getitem__(self, idx):
465 # pointers index into INDEX UOps (scalar lookup); everything else uses the shared mixin view path
466 if not isinstance(self.dtype, PtrDType): return super(UOp, self).__getitem__(idx)

Callers 15

gated_loadFunction · 0.95
gated_storeFunction · 0.95
__getitem__Method · 0.95
bufferize_to_storeFunction · 0.95
eval_uopFunction · 0.95
test_where_castMethod · 0.95
test_mulaccMethod · 0.95
test_gep_vec_foldMethod · 0.95

Calls 1

UOpClass · 0.85