Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IR] Create a make_tensor utility #1439

Closed
justinchuby opened this issue Apr 23, 2024 · 0 comments · Fixed by #1549
Closed

[IR] Create a make_tensor utility #1439

justinchuby opened this issue Apr 23, 2024 · 0 comments · Fixed by #1549
Assignees
Labels
contribution welcome We welcome code contributions for this topic: IR
Milestone

Comments

@justinchuby
Copy link
Contributor

justinchuby commented Apr 23, 2024

Create a make_tensor utility that will accept all sorts of tensor like objects and turn them into TensorProtocol objects for the IR. In this way we avoid serialization into ONNX TensorProto

@justinchuby justinchuby added contribution welcome We welcome code contributions for this topic: IR labels Apr 23, 2024
@justinchuby justinchuby added this to the 0.1 milestone May 9, 2024
@justinchuby justinchuby self-assigned this May 15, 2024
justinchuby added a commit that referenced this issue May 24, 2024
…_dtypes to support int4/bfloat16 (#1549)

Now possible to do

```python
tensor1 = ir.tensor(tensor_proto)
tensor2 = ir.tensor(np_array)
tensor3 = ir.tensor([1,2], dtype=ir.DataType.FLOAT)
```

supporting all ONNX dtypes.


- Added ml_dtypes as a new dependency and use it to support
int4/bfloat16.
- Removed the unused float32->float16 helper function

Tested: unit tests and doctests

Fixes #1439
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome We welcome code contributions for this topic: IR
Projects
None yet
1 participant