def test_do_not_fuse_transpose_with_add_not_1d(self):
        """
        We can't turn transposed_conv2d into transposed_conv2d_bias if the thing we do
        an add with is not 1d.
        """
        B = [1]
        CO, HH, WW, CI = 256, 28, 28, 256
        filter_HW = 2

        batch_dim = shape_utils.gen_int_var_min_max(B, name="batch_dim")
        bias = Tensor(
            shape=[batch_dim, 56, 56, CO], dtype="float16", name="bias", is_input=True
        )
        conv2d = self._build_conv2d(
            batch_dim, CO, HH, WW, CI, filter_HW, stride=2, transpose=True
        )
        output = ops.elementwise(FuncEnum.ADD)(bias, conv2d)
        output._attrs["is_output"] = True
        output._attrs["name"] = "output_0"

        target = detect_target()
        module = compile_model(
            output, target, "./tmp", "test_do_not_fuse_with_add_not_1d"
        )

        check_tensor = None
        for tensor in module.debug_sorted_graph:
            if tensor._attrs["name"] == "output_0":
                check_tensor = tensor
                break
        self.assertIsNotNone(check_tensor)
        self.assertEqual(len(check_tensor.src_ops()), 1)
        src_op = list(check_tensor.src_ops())[0]
        self.assertEqual(src_op._attrs["op"], "fused_elementwise")

        for b in B:
            X_pt = torch.randn(b, CI, HH, WW).cuda().half()
            W_pt = torch.randn(CO, CI, filter_HW, filter_HW).cuda().half()
            W_pt = torch.randn(CO, CI, filter_HW, filter_HW).cuda().half()
            Y_pt = torch.nn.functional.conv_transpose2d(X_pt, W_pt, stride=2)
            B_pt = torch.randn(b, CO, 56, 56).cuda().half()
            Y_pt = Y_pt + B_pt

            x = X_pt.permute((0, 2, 3, 1)).contiguous()
            w = W_pt.permute((0, 2, 3, 1)).contiguous()
            b_pt = B_pt.permute((0, 2, 3, 1)).contiguous()
            inputs = {"input_0": x, "input_1": w, "bias": b_pt}

            y = torch.empty([b, 56, 56, CO]).cuda().half()
            module.run_with_tensors(inputs, [y])
            y_transpose = y.permute(0, 3, 1, 2)
            self.assertTrue(torch.allclose(Y_pt, y_transpose, atol=1e-1, rtol=1e-1))

        We can't turn transposed_conv2d into transposed_conv2d_bias if the thing we do
        an add with is not 1d.
        
tests/unittest/compiler/test_fuse_conv_elementwise.py