MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / __get_nelements

Function __get_nelements

external/ggml/examples/python/ggml/utils.py:132–132  ·  view source on GitHub ↗
(tensor: TensorLike)

Source from the content-addressed store, hash-verified

130def __get_data(x: TensorLike) -> ffi.CData: return ffi.from_buffer(x) if isinstance(x, np.ndarray) else lib.ggml_get_data(x)
131def __get_nbytes(tensor: TensorLike): return tensor.nbytes if isinstance(tensor, np.ndarray) else lib.ggml_nbytes(tensor)
132def __get_nelements(tensor: TensorLike): return tensor.size if isinstance(tensor, np.ndarray) else lib.ggml_nelements(tensor)
133def __is_contiguous(tensor: TensorLike): return tensor.flags['C_CONTIGUOUS'] if isinstance(tensor, np.ndarray) else lib.ggml_is_contiguous(tensor)
134
135def __get_floats(tensor: TensorLike) -> ffi.CData:

Callers 2

__get_floatsFunction · 0.85
__set_floatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected