def test_str_dim():

    @typeguard.typechecked
    def _a_dim_checker(x: TensorType['a']):
        pass

    @typeguard.typechecked
    def _ab_dim_checker(x: TensorType[('a', 'b')]):
        pass

    @typeguard.typechecked
    def _abc_dim_checker(x: TensorType[('a', 'b', 'c')]):
        pass

    @typeguard.typechecked
    def _cb_dim_checker(x: TensorType[('c', 'b')]):
        pass

    @typeguard.typechecked
    def _am1_dim_checker(x: TensorType[('a', (- 1))]):
        pass

    @typeguard.typechecked
    def _m1b_dim_checker(x: TensorType[((- 1), 'b')]):
        pass

    @typeguard.typechecked
    def _abm1_dim_checker(x: TensorType[('a', 'b', (- 1))]):
        pass

    @typeguard.typechecked
    def _m1bm1_dim_checker(x: TensorType[((- 1), 'b', (- 1))]):
        pass
    x = torch.rand(3, 4)
    _ab_dim_checker(x)
    _cb_dim_checker(x)
    _am1_dim_checker(x)
    _m1b_dim_checker(x)
    with pytest.raises(TypeError):
        _a_dim_checker(x)
    with pytest.raises(TypeError):
        _abc_dim_checker(x)
    with pytest.raises(TypeError):
        _abm1_dim_checker(x)
    with pytest.raises(TypeError):
        _m1bm1_dim_checker(x)
def test_str_dim():

    @typeguard.typechecked
    def _a_dim_checker(x: TensorType['a']):
        pass

    @typeguard.typechecked
    def _ab_dim_checker(x: TensorType[('a', 'b')]):
        pass

    @typeguard.typechecked
    def _abc_dim_checker(x: TensorType[('a', 'b', 'c')]):
        pass

    @typeguard.typechecked
    def _cb_dim_checker(x: TensorType[('c', 'b')]):
        pass

    @typeguard.typechecked
    def _am1_dim_checker(x: TensorType[('a', (- 1))]):
        pass

    @typeguard.typechecked
    def _m1b_dim_checker(x: TensorType[((- 1), 'b')]):
        pass

    @typeguard.typechecked
    def _abm1_dim_checker(x: TensorType[('a', 'b', (- 1))]):
        pass

    @typeguard.typechecked
    def _m1bm1_dim_checker(x: TensorType[((- 1), 'b', (- 1))]):
        pass
    x = torch.rand(3, 4)
    _ab_dim_checker(x)
    _cb_dim_checker(x)
    _am1_dim_checker(x)
    _m1b_dim_checker(x)
    with pytest.raises(TypeError):
        _a_dim_checker(x)
    with pytest.raises(TypeError):
        _abc_dim_checker(x)
    with pytest.raises(TypeError):
        _abm1_dim_checker(x)
    with pytest.raises(TypeError):
        _m1bm1_dim_checker(x)