We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Subtensor
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
Unless I am missing something subtle about how slices work, I think those could all be treated equally:
import pytensor import pytensor.tensor as at x = pt.vector("x") y1 = x[:-1] y2 = x[0:-1] y3 = x[0:-1:1] f = pytensor.function([x], [y1, y2, y3]) pytensor.dprint(f)
DeepCopyOp [id A] '' 1 |Subtensor{:int64:} [id B] '' 0 |x [id C] |ScalarConstant{-1} [id D] DeepCopyOp [id E] '' 3 |Subtensor{int64:int64:} [id F] '' 2 |x [id C] |ScalarConstant{0} [id G] |ScalarConstant{-1} [id D] DeepCopyOp [id H] '' 5 |Subtensor{int64:int64:int64} [id I] '' 4 |x [id C] |ScalarConstant{0} [id G] |ScalarConstant{-1} [id D] |ScalarConstant{1} [id J]
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Please describe the purpose of filing this issue
Unless I am missing something subtle about how slices work, I think those could all be treated equally:
The text was updated successfully, but these errors were encountered: