code: def _get_tensor_summary(
      name,
      display_name,
      description,
      tensor,
      content_type,
      components,
      json_config,
      collections,
  ):
      """Creates a tensor summary with summary metadata.
  
      Args:
        name: Uniquely identifiable name of the summary op. Could be replaced by
          combination of name and type to make it unique even outside of this
          summary.
        display_name: Will be used as the display name in TensorBoard.
          Defaults to `tag`.
        description: A longform readable description of the summary data. Markdown
          is supported.
        tensor: Tensor to display in summary.
        content_type: Type of content inside the Tensor.
        components: Bitmask representing present parts (vertices, colors, etc.) that
          belong to the summary.
        json_config: A string, JSON-serialized dictionary of ThreeJS classes
          configuration.
        collections: List of collections to add this summary to.
  
      Returns:
        Tensor summary with metadata.
      """
      tensor = tf.convert_to_tensor(value=tensor)
      shape = tensor.shape.as_list()
      shape = [dim if dim is not None else -1 for dim in shape]
      tensor_metadata = metadata.create_summary_metadata(
          name,
          display_name,
          content_type,
          components,
          shape,
          description,
          json_config=json_config,
      )
      tensor_summary = tf.compat.v1.summary.tensor_summary(
          metadata.get_instance_name(name, content_type),
          tensor,
          summary_metadata=tensor_metadata,
          collections=collections,
      )
      return tensor_summary
  
file_path: tensorboard/tensorboard/plugins/mesh/summary.py
imports: import json
  import tensorflow
  from tensorboard.plugins.mesh import metadata
  from tensorboard.plugins.mesh import plugin_data_pb2
  from tensorboard.plugins.mesh import summary_v2
label_desc: Use image node_id 1 for calling a global function with example usage: _get_tensor_summary(name, display_name, description, tensor, content_type, components, json_config, collections) and returns: tensor_summary