transform

copy src to dst with broadcasting

void
transform
(
T
size_t dim
Storage
)
(
Tensor!(dim, T, Storage) src
,
ref Tensor!(dim, T, Storage) dst
,
T alpha = 1
,
T beta = 0
)

Examples

1 /// FIXME: int/long support
2 import grain.cuda.allocator : CuTensor;
3 import grain.ops.transposed : transposed;
4 auto x = CuTensor!(3, float)(2, 3, 4).transposed;
5 auto y = CuTensor!(3, float)(x.shape);
6 transform(x, y);
7 transform(y, x);

Meta