Namespace for mathematical operations on tensors. Useful with MLComponent.
Tensor broadcasting rules*
Tensor (channels, width, height) op Tensor (1, 1, 1) = the same as applying op with scalar
Tensor (channels, width, height) op Tensor (channels, 1, 1) = the same as applying op per channel
Example
// Convert a texture to an array of grayscale values // @input Asset.Texture texture
// Desired width and height of the grayscale texture // You can instead use Texture.getWidth() and Texture.getHeight() for original size varwidth = 64; varheight = 64;
Namespace for mathematical operations on tensors. Useful with MLComponent.
Tensor broadcasting rules*
Tensor (channels, width, height) op Tensor (1, 1, 1) = the same as applying op with scalar
Tensor (channels, width, height) op Tensor (channels, 1, 1) = the same as applying op per channel
Example