code: def _tobytes(tensor: np.ndarray) -> bytes:
      if not _is_little_endian(tensor):
          tensor = tensor.byteswap(inplace=False)
      return tensor.tobytes()
  
file_path: safetensors/bindings/python/py_src/safetensors/numpy.py
imports: import os
  import sys
  from typing import Dict, Optional, Union
  import numpy
  from safetensors import deserialize, safe_open, serialize, serialize_file
label_desc: Use image node_id 1 for calling a global function with example usage: _tobytes(tensor) and returns: tensor