pytorch/torch/_prims_common
Pian Pawakapan 54f736155b [dynamic shapes] guard_or_false for _reshape_view_helper, utils._infer_size for wildcard dims (#150127)
For reshape/view: removes fast paths for 0 elements, checking dimensions to skip. Modifies the loop accumulating input elements, to raise a UserError if we run out of dimensions, graph breaking for compile and erroring out for export.
For infer_size: assumes if user passes us an unbacked, it's probably not -1

Will think about changes in https://docs.google.com/document/d/1WYx6EZwVDXtBnWyrzoecgGWdiK0V3XZKftfpWwQ5i3E/edit?tab=t.0#heading=h.22k54zym11qp in a later PR

Pull Request resolved: https://github.com/pytorch/pytorch/pull/150127
Approved by: https://github.com/laithsakka
2025-04-23 05:42:30 +00:00
..
__init__.py [dynamic shapes] guard_or_false for _reshape_view_helper, utils._infer_size for wildcard dims (#150127) 2025-04-23 05:42:30 +00:00
wrappers.py Propagate callable parameter types using ParamSpec (#142306) (#151014) 2025-04-13 20:38:11 +00:00