We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
print_shape
debug_print
There's currently a print_type that includes the static shape but this is too verbose, if only thing we want is the shape of variables
print_type
import pytensor.tensor as pt x = pt.matrix("x", shape=(None, 3)) y = pt.broadcast_to(x * 5, (5, 7, 3)) y.dprint(print_type=True) # Alloc [id A] <Tensor3(float64, shape=(5, 7, 3))> # ├─ Mul [id B] <Matrix(float64, shape=(?, 3))> # │ ├─ x [id C] <Matrix(float64, shape=(?, 3))> # │ └─ ExpandDims{axes=[0, 1]} [id D] <Matrix(int8, shape=(1, 1))> # │ └─ 5 [id E] <Scalar(int8, shape=())> # ├─ 5 [id F] <Scalar(int8, shape=())> # ├─ 7 [id G] <Scalar(int8, shape=())> # └─ 3 [id H] <Scalar(int8, shape=())>
Desired behavior
y.dprint(print_shape=True) # Alloc [id A] shape=(5, 7, 3) # ├─ Mul [id B] shape=(?, 3) # │ ├─ x [id C] shape=(?, 3) # │ └─ ExpandDims{axes=[0, 1]} [id D] shape=(1, 1) # │ └─ 5 [id E] shape=() # ├─ 5 [id F] shape=() # ├─ 7 [id G] shape=() # └─ 3 [id H] shape=()
Just need to do be careful with types that don't have shape, like slices / None / rngs
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
There's currently a
print_type
that includes the static shape but this is too verbose, if only thing we want is the shape of variablesDesired behavior
Just need to do be careful with types that don't have shape, like slices / None / rngs
The text was updated successfully, but these errors were encountered: