Skip to content

Ability to create a tensor from a lambda #33

@ryanmrichard

Description

@ryanmrichard

TA provides the very useful TA::make_array which allows you to make a DistArray from a lambda. This issue is for adding a ctor to TensorWrapper which allows the user to write a lambda which fills in the tensor. I'm not 100% sure on what signature we want the lambda to have. A couple possibilities:

double(std::vector<int>); // Given an index return the value
void(std::vector<int> lo, std::vector<int> hi, double*); // Given the range of the block and the block's start fill it in

The first is more generalizable (to non-contiguous memory buffers, row- vs. column-major, etc.) and with modern compiler optimizations it may actually perform quite well.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions