Skip to content

Commit

Permalink
Extend Tensor creation APIs to support borrowed storage (#17925)
Browse files Browse the repository at this point in the history
### Ticket
N/A

### Problem description
Tensor doesn't provide good APIs for borrowed storage.

### What's changed
* `Tensor::from_borrowed_data` to create `Tensor` with borrowed storage.
* Simplified `pytensor.cpp` to use the new APIs instead of dealing with
low-level details.
* Remove `unpad_tensor_to_vec` - bespoke implementation of what
`tensor_impl::decode_tensor_data` is supposed to do.
* Add tests for creating `Tensor` with borrowed storage. Simplify tests
that deal with shard specs.
* Removed incorrect use of `explicit`, `inline`, `const` in borrowed /
owned buffer headers.

### Checklist
- [X] [All post
commit](https://github.com/tenstorrent/tt-metal/actions/runs/13618906914)
- [X] New/Existing tests provide coverage for changes
  • Loading branch information
omilyutin-tt authored Mar 2, 2025
1 parent c0bc884 commit 4bc3ae3
Show file tree
Hide file tree
Showing 7 changed files with 319 additions and 345 deletions.
Loading

0 comments on commit 4bc3ae3

Please sign in to comment.