feat(//core/conversion): Add support for aten::size with dynamic shaped models for Torchscript backend.#1647
feat(//core/conversion): Add support for aten::size with dynamic shaped models for Torchscript backend.#1647
Conversation
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
|
cc: @mfeliz-cruise |
core/conversion/evaluators/aten.cpp
Outdated
| [](ConversionCtx* ctx, const torch::jit::Node* n, kwargs& args) -> c10::optional<torch::jit::IValue> { | ||
| auto list_input = args.at(n->input(0)); | ||
| auto idx = args.at(n->input(1)).unwrapToInt(); | ||
| if (list_input.isIValue()){ |
There was a problem hiding this comment.
It looks like this implements one layer of look back, are there cases where this would fail in a new way or do those fallback to list_input.isIValue() to preserve the existing functionality?
There was a problem hiding this comment.
By look back, I'm imagining a case where we have something like list [idx1] [idx2]. I don't have an answer here (how both ITensor and IValue interplay) as it depends on how it is represented in the torchscript graph
|
This looks great @peri044. I left some questions about edge cases, but generally I fully support this change to add the ConversionCtx to the evaluator inputs. This opens up the possibility for us to implement alternative conversion paths for dynamic shapes for any evaluator. Thank you! |
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
Signed-off-by: Dheeraj Peri <peri.dheeraj@gmail.com>
feat(//core/conversion): Add support for aten::size with dynamic shaped models for Torchscript backend.
Description
#1577
Fixes issues listed in the above discussion
Type of change
Checklist: