parameters: (input_name, value, kwargs)
docstring: Helper function to create a tensor value node and a
      initializer tensor node with constant value.
docstring_summary: Helper function to create a tensor value node and a
      initializer tensor node with constant value.
docstring_tokens: Helper function to create a tensor value node and a initializer tensor node with constant value .
function: def create_const_node(input_name, value, kwargs):
      """Helper function to create a tensor value node and a
      initializer tensor node with constant value."""
      from onnx.helper import make_tensor
      initializer = kwargs["initializer"]
      dtype = value.dtype
      if dtype == 'float16':
          # when using float16, we must convert it to np.uint16 view first
          value = np.float16(value).view(np.uint16)
      input_type = onnx.mapping.NP_TYPE_TO_TENSOR_TYPE[dtype]
      input_shape = value.shape
      tensor_node = make_tensor(input_name, input_type, input_shape, value)
      initializer.append(tensor_node)
function_tokens: def create_const_node ( input_name , value , kwargs ) : from onnx . helper import make_tensor initializer = kwargs [ "initializer" ] dtype = value . dtype if dtype == 'float16' : # when using float16, we must convert it to np.uint16 view first value = np . float16 ( value ) . view ( np . uint16 ) input_type = onnx . mapping . NP_TYPE_TO_TENSOR_TYPE [ dtype ] input_shape = value . shape tensor_node = make_tensor ( input_name , input_type , input_shape , value ) initializer . append ( tensor_node )