code: def generate_scalar_constant(output_name, tensor_name, scalar):
      
      t = onnx.helper.make_tensor(tensor_name,
                                  data_type=TensorProto.FLOAT,
                                  dims=[1], vals=[scalar])
      c = onnx.helper.make_node("Constant",
                                [],
                                [output_name],
                                value=t)
      return c
docs: Convert a scalar value to a Constant buffer.
      This is mainly used for xxScalar operators.