docstr: Removes fields from a CostGraphDef protobuf.
  
  Helper method to reduce the initialization of CostGraphDef(s).
  
  Args:
    cost_graph: a CostGraphDef to strip.
    to_strip: a string, either "SIZES" or "DEVICES".
  
  Returns:
    a new CostGraphDef with either size information or device information
        stripped, as appropriate.
docstr_tok: ["Removes","fields","from","a","CostGraphDef","protobuf",".","Helper","method","to","reduce","the","initialization","of","CostGraphDef","(","s",")",".","Args",":","cost_graph",":","a","CostGraphDef","to","strip",".","to_strip",":","a","string",",","either","``","SIZES","''","or","``","DEVICES","''",".","Returns",":","a","new","CostGraphDef","with","either","size","information","or","device","information","stripped",",","as","appropriate","."]
code: def StripCostGraphDef(self, cost_graph, to_strip):
      """Removes fields from a CostGraphDef protobuf.
  
      Helper method to reduce the initialization of CostGraphDef(s).
  
      Args:
        cost_graph: a CostGraphDef to strip.
        to_strip: a string, either "SIZES" or "DEVICES".
  
      Returns:
        a new CostGraphDef with either size information or device information
            stripped, as appropriate.
      """
      new_cost_graph = cost_graph_pb2.CostGraphDef()
      new_cost_graph.CopyFrom(cost_graph)
      for node in new_cost_graph.node:
          if to_strip == "SIZES":
              for output_info in node.output_info:
                  output_info.size = 0
                  output_info.ClearField("shape")
          if to_strip == "DEVICES":
              node.ClearField("device")
      return new_cost_graph
  
file_path: mesh/mesh_tensorflow/auto_mtf/graph_interface_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import mesh_tensorflow
  from mesh_tensorflow.auto_mtf import graph_interface
  import tensorflow.compat.v1
  from tensorflow.core.framework import cost_graph_pb2
  from tensorflow.core.framework import tensor_shape_pb2
  from tensorflow.core.framework import types_pb2
label_desc: Use image node_id 2 for calling the GraphInterfaceTest obj's underlying member method code with example usage: obj.StripCostGraphDef(cost_graph, to_strip) and returns: new_cost_graph