Skip to content

ComponentTensor needs at least an index to have an extent #3825

Open
@ReubenHill

Description

@ReubenHill

ComponentTensor makes the below assertion:

class ComponentTensor(Node):
    __slots__ = ('children', 'multiindex', 'shape')
    __back__ = ('multiindex',)

    def __new__(cls, expression, multiindex):
        assert not expression.shape

        # Empty multiindex
        if not multiindex:
            return expression

        # Collect shape
        shape = tuple(index.extent for index in multiindex)
        assert all(s >= 0 for s in shape) ## <- HERE

which cannot be done if none of the indices have an extext.

This typically comes up when creating indices with gem.indices which do not set the extent property of the indices.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions