(x: 'numpy.ndarray')
| 39 | # **** Tensor helper functions **** |
| 40 | |
| 41 | def _fromnp(x: 'numpy.ndarray') -> UOp: |
| 42 | ret = UOp.new_buffer("NPY", x.size, _from_np_dtype(x.dtype)) |
| 43 | # fake realize |
| 44 | ret.buffer.allocate(x) |
| 45 | return ret.reshape(x.shape) |
| 46 | |
| 47 | def get_shape(x) -> tuple[int, ...]: |
| 48 | # NOTE: str is special because iterating it still yields strs |
no test coverage detected
searching dependent graphs…