parameters: (v, arg_name)
docstring: Convert v into a TensorShapeProto.
docstring_summary: Convert v into a TensorShapeProto.
docstring_tokens: Convert v into a TensorShapeProto .
function: def _MakeShape(v, arg_name):
    """Convert v into a TensorShapeProto."""
    # Args:
    #   v: A TensorShapeProto, a list of ints, or a tensor_shape.TensorShape.
    #   arg_name: String, for error messages.
  
    # Returns:
    #   A TensorShapeProto.
    if isinstance(v, tensor_shape_pb2.TensorShapeProto):
      for d in v.dim:
        if d.name:
          logging.warning("Warning: TensorShapeProto with a named dimension: %s",
                          str(v))
          break
      return v
    try:
      return tensor_shape.as_shape(v).as_proto()
    except TypeError as e:
      raise TypeError(f"Error converting {repr(v)} (arg name = {arg_name}) to a "
                      f"TensorShape: {e}")
    except ValueError as e:
      raise TypeError(f"Error converting {repr(v)} (arg name = {arg_name}) to a "
                      f"TensorShape: {e}")
function_tokens: def _MakeShape ( v , arg_name ) : # Args: #   v: A TensorShapeProto, a list of ints, or a tensor_shape.TensorShape. #   arg_name: String, for error messages. # Returns: #   A TensorShapeProto. if isinstance ( v , tensor_shape_pb2 . TensorShapeProto ) : for d in v . dim : if d . name : logging . warning ( "Warning: TensorShapeProto with a named dimension: %s" , str ( v ) ) break return v try : return tensor_shape . as_shape ( v ) . as_proto ( ) except TypeError as e : raise TypeError ( f"Error converting {repr(v)} (arg name = {arg_name}) to a " f"TensorShape: {e}" ) except ValueError as e : raise TypeError ( f"Error converting {repr(v)} (arg name = {arg_name}) to a " f"TensorShape: {e}" )