docstr: Build the placeholder_with_default testing graph.
docstr_tok: ["Build","the","placeholder_with_default","testing","graph","."]
code: def testConvertPlaceholderWithDefaultToConstant2(self):
      """Build the placeholder_with_default testing graph."""
      placeholder_name = "keras_learning_phase"
      a_constant_name = "a_constant"
      relu_name = "r_relu"
  
      g_def = graph_pb2.GraphDef()
      const_node = self.create_constant_node_def(
          a_constant_name, value=True, dtype=dtypes.bool, shape=[]
      )
      g_def.node.extend([const_node])
  
      ph_node = self.create_node_def(
          "PlaceholderWithDefault", placeholder_name, [a_constant_name]
      )
      self.set_attr_dtype(ph_node, "dtype", dtypes.bool)
      g_def.node.extend([ph_node])
  
      r_node = self.create_node_def(
          "Relu", relu_name, [placeholder_name]
      )
      g_def.node.extend([r_node])
  
      opt_graph_def = optimize_for_inference_lib.optimize_for_inference(
          g_def, [], [relu_name], dtypes.float32.as_datatype_enum
      )
      for node in opt_graph_def.node:
          self.assertNotEqual("PlaceholderWithDefault", node.op)
          if node.name == "keras_learning_phase":
              self.assertEqual(node.op, "Const")
              const_value = (
                  optimize_for_inference_lib.values_from_const(node)
              )
              self.assertEqual(const_value, False)
  
imports: import numpy
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.framework import node_def_pb2
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import importer
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_util
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_nn_ops
  from tensorflow.python.ops import image_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn_ops
  from tensorflow.python.platform import test
  from tensorflow.python.tools import optimize_for_inference_lib
label_desc: Use image node_id 9 for calling the OptimizeForInferenceTest obj's underlying member method code with example usage: obj.testConvertPlaceholderWithDefaultToConstant2() without return types