code: def create_constant_node_def(self, name, value, dtype, shape=None):
      node = self.create_node_def("Const", name, [])
      self.set_attr_dtype(node, "dtype", dtype)
      self.set_attr_tensor(node, "value", value, dtype, shape)
      return node
  
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 2 for calling the OptimizeForInferenceTest obj's underlying member method code with example usage: obj.create_constant_node_def(name, value, dtype, shape) and returns: node