Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Subtensor shape incorrect shape inference #922

@larryshamalama

Description

@larryshamalama

There seems to be an issue with static shape inference for Subtensor ops. Below is an example provided by @brandonwillard in PR #901:

import aesara.tensor as at

y = at.tensor(dtype="float32", shape=(2,))
y.type.shape
# (2,)

# We know that the shape of this should be equal to the shape of `y`
z = y[slice(None)]

aesara.dprint(z, print_type=True)
# Subtensor{::} [id A] <TensorType(float32, (None,))> ''   
#  |<TensorType(float32, (2,))> [id B] <TensorType(float32, (2,))>

z.type.shape
# (None,)

See comment here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions