Quantcast
Viewing latest article 24
Browse Latest Browse All 109

Tensor Operations with 1.4

I’m currently checking out the new 1.4 version of Sentis. Some promising stuff in there!

So far I’ve heavily used Ops to process tensor data that I’m now looking to port to IBackend.

issue with operations with scalar values?

Regarding the new docs page for Tensor Operations:

The example code in the documentation uses backend.Mul(randomTensor, mulTensor, 255f); but there doesn’t seem to be an overload that takes a scalar on IBackend. Is that a documentation issue, missing implementation or am I using it incorrectly?

question on tensor management

Other than that, the docs page gives a good overview of how to use it but focuses on operations where the result tensor has a different shape/size.

I’m wondering, what the best practice is with common operations that could be done in-place.
Let’s say I want to calculate:
x = a * b;

Following the docs I’d do

using TensorFloat x = TensorFloat.AllocNoData(a.shape);
backend.Mul(a, b, x);

Assuming a and b have the same shape, could I also reuse a as the output tensor and do

backend.Mul(a, b, a);

General thoughts on this? Good idea or no?

1 post - 1 participant

Read full topic


Viewing latest article 24
Browse Latest Browse All 109

Trending Articles