Tags: onnx/ir-py
Tags
Remove import from _custom_element_types in test (#136) Remove import from _custom_element_types in test because the module is removed in the latest version of onnx. I chose to remove the entries instead of doing version checks because I don't expect the logic to be broken for older onnx versions. When we bump the lowest supported onnx version to be 1.19, we can remove the logic handling the custom types in the from_numpy() method as well. --------- Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Fix 4bit tensor unpacking (#118) 4bit tensor unpacking to numpy array was buggy before this fix. I updated the logic to make sure we correctly handle the bytes when converting to numpy. Added unit tests for all numeric dtypes. --------- Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Support numpy scalars in `Tensor` (#102) Numpy scalars (https://numpy.org/doc/2.2/reference/arrays.scalars.html) have `__array__` defined but doesn't behave like normal np arrays sometimes. This change updates the initialization logic in `Tensor` to detect them and turn them into np.ndarray. Fixes #101. --------- Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
Convenience function get_const_tensor (#45) Get the constant tensor from a value, if it exists. A constant tensor can be obtained if the value has a ``const_value`` set (as in the case of an initializer) or if the value is produced by a Constant node. This function will not alter the ``const_value`` of the value, but it will propagate the shape and type of the constant tensor to the value if `propagate_shape_type` is set to True. --------- Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> Co-authored-by: codecov-ai[bot] <156709835+codecov-ai[bot]@users.noreply.github.com>
[pass] Add CSE (#36) CSE pass from microsoft/onnxscript#2304 --------- Signed-off-by: Ti-Tai Wang <titaiwang@microsoft.com> Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>