code: def _get_shape(tensor):
      """Returns the tensor's shape.
  
       Each shape element is either:
       - an `int`, when static shape values are available, or
       - a `tf.Tensor`, when the shape is dynamic.
  
      Args:
        tensor: A `tf.Tensor` to get the shape of.
  
      Returns:
        The `list` which contains the tensor's shape.
      """
  
      shape_list = tensor.shape.as_list()
      if all(s is not None for s in shape_list):
          return shape_list
      shape_tensor = tf.shape(tensor)
      return [
          shape_tensor[i] if s is None else s
          for i, s in enumerate(shape_list)
      ]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import functools
  from absl import logging
  from graph_nets import graphs
  from graph_nets import utils_np
  import six
  from six.moves import range
  import tensorflow
  import tree
label_desc: Use image node_id 1 for calling a global function with example usage: _get_shape(tensor) and returns: unknown, shape_list