code: def optional_param_to_tensor(
      argument_name,
      argument_value,
      argument_default=0,
      argument_dtype=dtypes.int64,
  ):
      if argument_value is not None:
          return ops.convert_to_tensor(
              argument_value, dtype=argument_dtype, name=argument_name
          )
      else:
          return constant_op.constant(
              argument_default, dtype=argument_dtype, name=argument_name
          )
  
imports: from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor_shape
label_desc: Use image node_id 1 for calling a global function with example usage: optional_param_to_tensor(argument_name, argument_value, argument_default, argument_dtype) and returns: ops, constant_op