code: def encode_array(x: np.ndarray) -> bytes:
      """Encodes a numpy array using `TensorProto` protocol buffer."""
      return tf.make_tensor_proto(x).SerializeToString()
  
file_path: tf-quant-finance/tf_quant_finance/experimental/io.py
imports: from typing import Dict, Callable, Optional
  import numpy
  import tensorflow.compat.v2
label_desc: Use image node_id 1 for calling a global function with example usage: encode_array(x) and returns: tf