code: def test_initializer(self):
      X = np.array([[1, 2], [3, 4]]).astype(np.float32)
      Y = np.array([[1, 2], [3, 4]]).astype(np.float32)
      weight = np.array([[1, 0], [0, 1]])
      graph_def = make_graph(
          [
              make_node("Add", ["X", "Y"], ["Z0"]),
              make_node(
                  "Cast", ["Z0"], ["Z"], to=onnx.TensorProto.FLOAT
              ),
              make_node("Mul", ["Z", "weight"], ["W0"]),
              make_node("Tanh", ["W0"], ["W1"]),
              make_node("Sigmoid", ["W1"], ["W2"]),
              make_node("Scale", ["W2"], ["W3"], scale=-1.0),
          ],
          name="test_initializer",
          inputs=[
              make_tensor_value_info(
                  "X", onnx.TensorProto.FLOAT, (2, 2)
              ),
              make_tensor_value_info(
                  "Y", onnx.TensorProto.FLOAT, (2, 2)
              ),
              make_tensor_value_info(
                  "weight", onnx.TensorProto.FLOAT, (2, 2)
              ),
          ],
          outputs=[
              make_tensor_value_info(
                  "W3", onnx.TensorProto.FLOAT, (2, 2)
              )
          ],
          initializer=[
              make_tensor(
                  "weight",
                  onnx.TensorProto.FLOAT,
                  [2, 2],
                  weight.flatten().astype(float),
              )
          ],
      )
  
      def sigmoid(x):
          return 1 / (1 + np.exp(-x))
  
      W_ref = -sigmoid(np.tanh((X + Y) * weight))
      c2_rep = c2.prepare(
          make_model(graph_def, producer_name="caffe2-ref-test")
      )
      output = c2_rep.run({"X": X, "Y": Y})
      np.testing.assert_almost_equal(output["W3"], W_ref)
  
imports: import os
  import unittest
  from caffe2.python import core
  from caffe2.proto import caffe2_pb2
  import onnx
  from onnx.helper import make_node, make_graph, make_tensor, make_tensor_value_info, make_model
  from caffe2.python.onnx.helper import c2_native_run_net, c2_native_run_op
  from onnx import mapping
  import caffe2.python.onnx.frontend
  import caffe2.python.onnx.backend
  import numpy
  from caffe2.python.models.download import ModelDownloader
  from caffe2.python.onnx.tests.test_utils import TestCase
  import caffe2.python._import_c_extension
label_desc: Use image node_id 7 for calling the TestCaffe2Basic obj's underlying member method code with example usage: obj.test_initializer() and returns: unknown