parameters: (op, require_shape_fn=True)
docstring: A shape function that delegates to the registered C++ shape function.
  
    Args:
      op: the node in the graph for which to compute output shapes.
      require_shape_fn: If true, and the C++ shape function is not registered
        in the current binary then an exception is raised; otherwise, if the
        C++ shape function is not registered then unknown_shape is used.
  
    Returns:
      A dictionary with the following keys:
        shapes: A TensorShape list of the output shapes of the op, as computed
          using the C++ shape inference function registered for the op.
        handle_shapes: A TensorShape list of the shapes for handle outputs, if
           any.
        handle_dtypes: A list of DataType enums for the handle outputs, if any.
  
    Raises:
      ValueError: If the C++ shape function returned an error (e.g. because the
        shapes of the inputs are of the wrong rank or otherwise incompatible
        according to the shape function).
      RuntimeError: If the C++ shape function is not registered and
        <require_shape_fn> is True.
docstring_summary: A shape function that delegates to the registered C++ shape function.
docstring_tokens: A shape function that delegates to the registered C ++ shape function .
function: def call_cpp_shape_fn(op, require_shape_fn=True):
    """A shape function that delegates to the registered C++ shape function.
  
    Args:
      op: the node in the graph for which to compute output shapes.
      require_shape_fn: If true, and the C++ shape function is not registered
        in the current binary then an exception is raised; otherwise, if the
        C++ shape function is not registered then unknown_shape is used.
  
    Returns:
      A dictionary with the following keys:
        shapes: A TensorShape list of the output shapes of the op, as computed
          using the C++ shape inference function registered for the op.
        handle_shapes: A TensorShape list of the shapes for handle outputs, if
           any.
        handle_dtypes: A list of DataType enums for the handle outputs, if any.
  
    Raises:
      ValueError: If the C++ shape function returned an error (e.g. because the
        shapes of the inputs are of the wrong rank or otherwise incompatible
        according to the shape function).
      RuntimeError: If the C++ shape function is not registered and
        <require_shape_fn> is True.
    """
    if op.type == "Const":
      # To avoid serializing large constants, we special-case constant
      # here, even though it has a C++ shape function.  When Python
      # calls the C / C-API directly, we should be able to remove this.
      return {
          "shapes": [tensor_shape.TensorShape(op.get_attr("value").tensor_shape)],
          "handle_data": [None]
      }
  
    input_tensors_needed = []
    input_tensors_as_shapes_needed = []
  
    while True:
      res = _call_cpp_shape_fn_impl(op, input_tensors_needed,
                                    input_tensors_as_shapes_needed,
                                    require_shape_fn)
      if not isinstance(res, dict):
        # Handles the case where _call_cpp_shape_fn_impl calls unknown_shape(op).
        return res
  
      # See if we need to evaluate some inputs.
      if not res["inputs_needed"]:
        return res
      p = cpp_shape_inference_pb2.CppShapeInferenceInputsNeeded()
      p = p.FromString(res["inputs_needed"])
      changed = False
      for idx in p.input_tensors_needed:
        if idx not in input_tensors_needed:
          input_tensors_needed.append(idx)
          changed = True
      for idx in p.input_tensors_as_shapes_needed:
        if idx not in input_tensors_as_shapes_needed:
          input_tensors_as_shapes_needed.append(idx)
          changed = True
      if not changed:
        return res
function_tokens: def call_cpp_shape_fn ( op , require_shape_fn = True ) : if op . type == "Const" : # To avoid serializing large constants, we special-case constant # here, even though it has a C++ shape function.  When Python # calls the C / C-API directly, we should be able to remove this. return { "shapes" : [ tensor_shape . TensorShape ( op . get_attr ( "value" ) . tensor_shape ) ] , "handle_data" : [ None ] } input_tensors_needed = [ ] input_tensors_as_shapes_needed = [ ] while True : res = _call_cpp_shape_fn_impl ( op , input_tensors_needed , input_tensors_as_shapes_needed , require_shape_fn ) if not isinstance ( res , dict ) : # Handles the case where _call_cpp_shape_fn_impl calls unknown_shape(op). return res # See if we need to evaluate some inputs. if not res [ "inputs_needed" ] : return res p = cpp_shape_inference_pb2 . CppShapeInferenceInputsNeeded ( ) p = p . FromString ( res [ "inputs_needed" ] ) changed = False for idx in p . input_tensors_needed : if idx not in input_tensors_needed : input_tensors_needed . append ( idx ) changed = True for idx in p . input_tensors_as_shapes_needed : if idx not in input_tensors_as_shapes_needed : input_tensors_as_shapes_needed . append ( idx ) changed = True if not changed : return res