code: def _tensor_size(tensor_proto):
      """Compute the number of elements in a tensor.
  
      This does not deserialize the full tensor contents.
  
      Args:
        tensor_proto: A `tensorboard.compat.proto.tensor_pb2.TensorProto`.
  
      Returns:
        A non-negative `int`.
      """
      # This is the same logic that `tensor_util.make_ndarray` uses to
      # compute the size, but without the actual buffer copies.
      result = 1
      for dim in tensor_proto.tensor_shape.dim:
          result *= dim.size
      return result
  
imports: import base64
  import collections
  import json
  import random
  from tensorboard import errors
  from tensorboard.compat.proto import summary_pb2
  from tensorboard.data import provider
  from tensorboard.util import tb_logging
  from tensorboard.util import tensor_util
label_desc: Use image node_id 6 for calling a global function with example usage: _tensor_size(tensor_proto) and returns: result