def _tobytes()

in bindings/python/py_src/safetensors/numpy.py [0:0]


def _tobytes(tensor: np.ndarray) -> bytes:
    if not _is_little_endian(tensor):
        tensor = tensor.byteswap(inplace=False)
    return tensor.tobytes()