def is_valid_inputs(cls, A: Tensor, B: Tensor, C: Tensor):
        """
        This method should only be called from subclasses of bmm_xxx_add, since
        _SpecializedBase is defined there. For the parent class bmm_xxx_add itself
        call is_valid_inputs_unspecialized instead.
        """
        if not hasattr(cls, "_SpecializedBase"):
            raise NotImplementedError(
                "Call bmm_xxx_add.is_valid_inputs_unspecialized instead of bmm_xxx_add.is_valid_inputs. The latter is only defined for child classes of bmm_xxx_add."
            )
        output_shapes = cls._SpecializedBase()._infer_shapes(A, B)
        c_shapes = C.shape()
        return bmm_is_valid_inputs(output_shapes, c_shapes)

        This method should only be called from subclasses of bmm_xxx_add, since
        _SpecializedBase is defined there. For the parent class bmm_xxx_add itself
        call is_valid_inputs_unspecialized instead.
        
python/aitemplate/compiler/ops/gemm_universal/bmm_xxx_add.py