    def test_no_view(self, test_name="no_view"):
        """
        Case: Simple case with one output.
        """
        x = gen_input_tensor(shape=self.SHAPE, name="input_x")
        gelu = ops.elementwise(FuncEnum.GELU)(x)
        output = ops.flatten()(gelu)
        output._attrs["is_output"] = True
        output._attrs["name"] = "output_0"

        compile_model(
            [output],
            detect_target(),
            self.WORKDIR,
            test_name,
            do_optimize_graph=True,
        )

        expected_codegen = (
            # input_x is assigned to params_[0].ptr
            set_value("param_names_[1]", '"output_0"'),
        )
        self._assert_codegen_exists(
            test_name, expected_codegen, self.MODEL_CONTAINER_FILE
        )

        expected_codegen = (
            set_value(
                "output_0",
                "static_cast<decltype(output_0)>(params_[1].ptr)",
            ),
        )
        self._assert_codegen_exists(
            test_name, expected_codegen, self.MODEL_GENERATED_FILE
        )
Case: Simple case with one output.
tests/unittest/backend/test_codegen_output_tensor.py