[ONNX] Enable export af aten::__derive_index#48019
[ONNX] Enable export af aten::__derive_index#48019neginraoof wants to merge 7 commits intopytorch:masterfrom
Conversation
💊 CI failures summary and remediationsAs of commit 3a8e823 (more details on the Dr. CI page): ✅ None of the CI failures appear to be your fault 💚
1 failure confirmed as flaky and can be ignored:
❄️ 1 failure tentatively classified as flakybut reruns have not yet been triggered to confirm:
|
| class MyModule(torch.nn.Module): | ||
| def forward(self, x: torch.Tensor): | ||
| j = [] | ||
| for idx in range(len(x) - 1, -len(x), -2): |
There was a problem hiding this comment.
For constant start and end, would it trigger __range_length? If so, can we add unit test for constant start end to include the corner case there?
| return g.op("Add", start, g.op("Mul", index, step)) | ||
|
|
||
|
|
||
| def __range_length(g, lo, hi, step): |
There was a problem hiding this comment.
Consider adding link to source in comment, and copying the code of computation as well for reference.
if (step > 0 && lo < hi) {
push(stack, 1 + (hi - 1 - lo) / step);
} else if (step < 0 && lo > hi) {
push(stack, 1 + (lo - 1 - hi) / (0 - step));
} else {
push(stack, 0);
}The current symbolic should be equivalent with the positive case, is it also equivalent with the case when (hi-lo) and step are both negative?
There was a problem hiding this comment.
This is covered in tests for:
for idx in range(len(x) - 1, -len(x), -2):
Enable export af aten::__derive_index