Skip to content

To array#114

Open
marcelluethi wants to merge 2 commits into
dimwit-dev:mainfrom
marcelluethi:to-array
Open

To array#114
marcelluethi wants to merge 2 commits into
dimwit-dev:mainfrom
marcelluethi:to-array

Conversation

@marcelluethi
Copy link
Copy Markdown
Contributor

So far there is no simple way to get the content of the tensor as a Scala array. In this PR I propose a type-class based mechanism to convert a 1/2/3D tensor to a corresponding 1/2/3D Array.

The syntax is as follows

t : Tensor[A, B, Float32] = ???
arrayData = t.toArray

The type is automatically inferred from the type of the tensor and the receiving argument.

@marcelluethi marcelluethi requested a review from benikm91 May 30, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant