You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar idea to #89, but this time we're adding Expression::allocator. I'm not 100% sure what the signature for Expression::allocator should be, but my guess is:
i.e., it takes the labels and shape for temporary tensor the expression is being assigned to and returns the allocator (I think the shape is needed to work out tilings, for example).
This requires modifying the body of methods like Add::tensor_ along the lines of:
// Get the labels for the three tensorsconstauto a_labels = exp_a.labels(lhs_labels);
constauto b_labels = exp_b.labels(lhs_labels);
constauto& c_labels = lhs_labels;
// Get the shapes for the three tensorsauto a_shape = exp_a.shape(a_labels);
auto b_shape = exp_b.shape(b_labels);
Shape c_shape;
a_shape.add(a_labels, c_labels, c_shape, b_labels, b_shape);
// Get the allocators for the three tensorsauto a_alloc = exp_a.allocator(a_labels, a_shape);
auto b_alloc = exp_b.allocator(b_labels, b_shape);
Allocator c_alloc;
a_alloc.add(a_labels, c_labels, c_alloc, b_labels, b_alloc);
The text was updated successfully, but these errors were encountered:
Issue Description
Similar idea to #89, but this time we're adding
Expression::allocator
. I'm not 100% sure what the signature forExpression::allocator
should be, but my guess is:Allocator allocator(const_annotation_type out_labels, const_shape_reference out_shape);
i.e., it takes the labels and shape for temporary tensor the expression is being assigned to and returns the allocator (I think the shape is needed to work out tilings, for example).
This requires modifying the body of methods like
Add::tensor_
along the lines of:The text was updated successfully, but these errors were encountered: