You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[IR] Fix sequence handling in tensor function (#2252)
(Copilot) Fix bug in `tensor()` function to handle empty sequences and
require `dtype` when value is an empty sequence.
* Add a check to ensure the sequence is non-empty before performing type
checks in the `tensor()` function in
`onnxscript/ir/_convenience/_constructors.py`.
* Raise a `ValueError` if `dtype` is `None` and `value` is an empty
sequence in the `tensor()` function.
* Update the `tensor()` function to handle the case when a sequence is
empty explicitly.
* Add a test case to check if `tensor()` raises a `ValueError` when
`dtype` is `None` and `value` is an empty sequence in
`onnxscript/ir/_convenience/_constructors_test.py`.
* Add a test case to check if `tensor()` handles the case when a
sequence is empty explicitly.
---
For more details, open the [Copilot Workspace
session](https://copilot-workspace.githubnext.com/microsoft/onnxscript/pull/2252?shareId=2ab5ada5-c6bd-4bc8-be2d-e9357dcbaa7b).
0 commit comments