NumSharp icon indicating copy to clipboard operation
NumSharp copied to clipboard

Slice assign

Open burungiu opened this issue 2 years ago • 1 comments

Hello everyone, there is a way to do assigment as in python? Example: preds[:, :, 0] = preds[:, :, 0] % heatmapWidth

Thank you

burungiu avatar Jan 30 '23 10:01 burungiu

There is an issue with auto-broadening of scalar operands in the framework.

For instance:

var foo = (array > 12f); // fails var foo = np.full(12f, array.shape); var result = (array > foo); // successful

In your "heatmapWidth" operand just create an "np.full(heatmapWidth, preds.shape)" NDArray and use that as the operand. I bet that will work for you.

bojake avatar Feb 28 '23 17:02 bojake