MCPcopy
hub / github.com/tinygrad/tinygrad / ctensor

Method ctensor

tinygrad/tensor.py:1118–1120  ·  view source on GitHub ↗
(l: Sequence[PyConst], dtype: DType = dtypes.uint64)

Source from the content-addressed store, hash-verified

1116 # https://keccak.team/keccak_specs_summary.html
1117
1118 def ctensor(l: Sequence[PyConst], dtype: DType = dtypes.uint64):
1119 # TODO: contiguous is here for compile speed
1120 return Tensor.stack(*(Tensor(v, dtype=dtype, device=self.device) for v in l)).contiguous()
1121 rot_offsets = [44, 43, 21, 14, 28, 20, 3, 45, 61, 1, 6, 25, 8, 18, 27, 36, 10, 15, 56, 62, 55, 39, 41, 2]
1122 rot_offsets_v0, rot_offsets_v1 = ctensor([0] + [1 << v for v in rot_offsets]), ctensor([1] + [1 << (64 - v) for v in rot_offsets])
1123

Callers

nothing calls this directly

Calls 3

TensorClass · 0.85
stackMethod · 0.80
contiguousMethod · 0.45

Tested by

no test coverage detected