code: def tf_to_numpy(batch):
      """Convert a input batch from tf Tensors to numpy arrays.
  
      Args:
        batch: dict; A dictionary tha has items in a batch: image and labels.
  
      Returns:
        Numpy arrays of the given tf Tensors.
      """
      # Transforms x into read-only numpy array without copy if possible, see:
      # https://github.com/tensorflow/tensorflow/issues/33254#issuecomment-542379165
      convert_data = lambda x: np.asarray(memoryview(x))
      return jax.tree_util.tree_map(convert_data, batch)
  
file_path: scenic/scenic/dataset_lib/big_transfer/bit.py
imports: import functools
  from typing import Optional
  from absl import logging
  from flax import jax_utils
  import jax
  import jax.numpy
  import ml_collections
  import numpy
  from scenic.dataset_lib import dataset_utils
  from scenic.dataset_lib import datasets
  from scenic.dataset_lib.big_transfer import builder
  from scenic.dataset_lib.big_transfer.preprocessing import vtab_ops
label_desc: Use image node_id 1 for calling a global function with example usage: tf_to_numpy(batch) and returns: jax