def METHOD_NAME(self):
    @dataclasses.dataclass
    class MyDataClass(ModelOutput):
        a: torch.Tensor
        b: torch.Tensor = None
        c: torch.Tensor = None
        d: torch.Tensor = None
        e: torch.Tensor = None
    def fn(obj):
        class_fields = dataclasses.fields(obj)
        assert len(class_fields)
        assert all(field.default is None for field in class_fields[1:])
        other_fields_are_none = all(
            getattr(obj, field.name) is None for field in class_fields[1:]
        )
        assert not other_fields_are_none
        total = getattr(obj, class_fields[0].name)
        for field in class_fields[1:]:
            v = getattr(obj, field.name)
            if v is not None:
                total += v
        return total
    tensors = [torch.randn(10), torch.randn(10), torch.randn(10)]
    obj1 = MyDataClass(*tensors)
    correct1 = fn(obj1)
    obj2 = MyDataClass(*tensors)
    cnts = torch._dynamo.testing.CompileCounter()
    opt_fn = torch._dynamo.optimize(cnts)(fn)
    self.assertTrue(same(opt_fn(obj2), correct1))
    self.assertEqual(cnts.frame_count, 1)
    self.assertEqual(cnts.op_count, 2)