The OpenVX Specification  dba1aa3
Tensor Multiply

Detailed Description

Performs element wise multiplications on element values in the input tensor data with a scale.

Pixel-wise multiplication is performed between the pixel values in two tensors and a scalar floating-point number scale. The scale with a value of \( {1}/{2^n} \), where n is an integer and \( 0 \le n \le 15 \), and 1/255 (0x1.010102p-8 C99 float hex) must be supported. The support for other values of scale is not prohibited. Furthermore, for scale with a value of 1/255 the rounding policy of VX_ROUND_POLICY_TO_NEAREST_EVEN must be supported whereas for the scale with value of \( {1}/{2^n} \) the rounding policy of VX_ROUND_POLICY_TO_ZERO must be supported. The support of other rounding modes for any values of scale is not prohibited.

Functions

vx_node VX_API_CALL vxTensorMultiplyNode (vx_graph graph, vx_tensor input1, vx_tensor input2, vx_scalar scale, vx_enum overflow_policy, vx_enum rounding_policy, vx_tensor output)
 [Graph] Performs element wise multiplications on element values in the input tensor data with a scale. More...
 
vx_status VX_API_CALL vxuTensorMultiply (vx_context context, vx_tensor input1, vx_tensor input2, vx_scalar scale, vx_enum overflow_policy, vx_enum rounding_policy, vx_tensor output)
 [Immediate] Performs element wise multiplications on element values in the input tensor data with a scale. More...
 

Function Documentation

vx_node VX_API_CALL vxTensorMultiplyNode ( vx_graph  graph,
vx_tensor  input1,
vx_tensor  input2,
vx_scalar  scale,
vx_enum  overflow_policy,
vx_enum  rounding_policy,
vx_tensor  output 
)

[Graph] Performs element wise multiplications on element values in the input tensor data with a scale.

Parameters
[in]graphThe handle to the graph.
[in]input1Input tensor data. Implementations must support input tensor data type VX_TYPE_INT16 with fixed_point_position 8, and tensor data types VX_TYPE_UINT8 and VX_TYPE_INT8, with fixed_point_position 0.
[in]input2Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1. In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1, and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal. The data type must match the data type of Input1.
[in]scaleA non-negative VX_TYPE_FLOAT32 multiplied to each product before overflow handling.
[in]overflow_policyA vx_convert_policy_e enumeration.
[in]rounding_policyA vx_round_policy_e enumeration.
[out]outputThe output tensor data with the same dimensions as the input tensor data.
Returns
vx_node.
A node reference vx_node. Any possible errors preventing a successful creation should be checked using vxGetStatus.
vx_status VX_API_CALL vxuTensorMultiply ( vx_context  context,
vx_tensor  input1,
vx_tensor  input2,
vx_scalar  scale,
vx_enum  overflow_policy,
vx_enum  rounding_policy,
vx_tensor  output 
)

[Immediate] Performs element wise multiplications on element values in the input tensor data with a scale.

Parameters
[in]contextThe reference to the overall context.
[in]input1Input tensor data. Implementations must support input tensor data type VX_TYPE_INT16 with fixed_point_position 8, and tensor data types VX_TYPE_UINT8 and VX_TYPE_INT8, with fixed_point_position 0.
[in]input2Input tensor data. The dimensions and sizes of input2 match those of input1, unless the vx_tensor of one or more dimensions in input2 is 1. In this case, those dimensions are treated as if this tensor was expanded to match the size of the corresponding dimension of input1, and data was duplicated on all terms in that dimension. After this expansion, the dimensions will be equal. The data type must match the data type of Input1.
[in]scaleA non-negative VX_TYPE_FLOAT32 multiplied to each product before overflow handling.
[in]overflow_policyA vx_convert_policy_e enumeration.
[in]rounding_policyA vx_round_policy_e enumeration.
[out]outputThe output tensor data with the same dimensions as the input tensor data.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSSuccess
*An error occurred. See vx_status_e.