aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarat Dukhan <maratek@google.com>2020-06-05 16:52:42 -0700
committerXNNPACK Team <xnnpack-github-robot@google.com>2020-06-05 16:53:21 -0700
commit9d3a459441c272d82be14b579656b961066eba2c (patch)
treedce04897333c333a54501d7dd4cd607a561ba465 /include
parentf73992602aace3de615d16fa918906c9c225e9ec (diff)
downloadXNNPACK-9d3a459441c272d82be14b579656b961066eba2c.tar.gz
Divide/Subtract/Minimum2/Maximum2/SquaredDifference in Subgraph API
PiperOrigin-RevId: 315020715
Diffstat (limited to 'include')
-rw-r--r--include/xnnpack.h129
1 files changed, 129 insertions, 0 deletions
diff --git a/include/xnnpack.h b/include/xnnpack.h
index a89c84c84..705af8730 100644
--- a/include/xnnpack.h
+++ b/include/xnnpack.h
@@ -612,6 +612,135 @@ enum xnn_status xnn_define_multiply2(
uint32_t output_id,
uint32_t flags);
+/// Define a Subtract Node and add it to a Subgraph.
+///
+/// The Subtract Node computes elementwise subtraction of two tensor inputs with numpy broadcasting rules.
+///
+/// @param subgraph - a Subgraph object that will own the created Node.
+/// @param output_min - lower bound for clipping output values.
+/// @param output_max - upper bound for clipping output values.
+/// @param input1_id - Value ID for the first input tensor. The input tensor must be an N-dimensional tensor defined in
+/// the @a subgraph with each dimension either equal to the corresponding dimension of the second
+/// input, or equal to 1. In the latter case, the elements of the input tensor are broadcasted along
+/// that dimension.
+/// @param input2_id - Value ID for the second input tensor. The input tensor must be an M-dimensional tensor defined in
+/// the @a subgraph with each dimension either equal to the corresponding dimension of the first
+/// input, or equal to 1. In the latter case, the elements of the input tensor are broadcasted along
+/// that dimension.
+/// @param output_id - Value ID for the output tensor. The output tensor must be a max(N,M)-dimensional tensor defined
+/// in the @a subgraph with each dimension equal to the maximum between the corresponding dimension
+/// of the two inputs.
+/// @param flags - binary features of the Subtract Node. No supported flags are currently defined.
+enum xnn_status xnn_define_subtract(
+ xnn_subgraph_t subgraph,
+ float output_min,
+ float output_max,
+ uint32_t input1_id,
+ uint32_t input2_id,
+ uint32_t output_id,
+ uint32_t flags);
+
+/// Define a Divide Node and add it to a Subgraph.
+///
+/// The Divide Node computes elementwise division of two tensor inputs with numpy broadcasting rules.
+///
+/// @param subgraph - a Subgraph object that will own the created Node.
+/// @param output_min - lower bound for clipping output values.
+/// @param output_max - upper bound for clipping output values.
+/// @param input1_id - Value ID for the first input tensor. The input tensor must be an N-dimensional tensor defined in
+/// the @a subgraph with each dimension either equal to the corresponding dimension of the second
+/// input, or equal to 1. In the latter case, the elements of the input tensor are broadcasted along
+/// that dimension.
+/// @param input2_id - Value ID for the second input tensor. The input tensor must be an M-dimensional tensor defined in
+/// the @a subgraph with each dimension either equal to the corresponding dimension of the first
+/// input, or equal to 1. In the latter case, the elements of the input tensor are broadcasted along
+/// that dimension.
+/// @param output_id - Value ID for the output tensor. The output tensor must be a max(N,M)-dimensional tensor defined
+/// in the @a subgraph with each dimension equal to the maximum between the corresponding dimension
+/// of the two inputs.
+/// @param flags - binary features of the Divide Node. No supported flags are currently defined.
+enum xnn_status xnn_define_divide(
+ xnn_subgraph_t subgraph,
+ float output_min,
+ float output_max,
+ uint32_t input1_id,
+ uint32_t input2_id,
+ uint32_t output_id,
+ uint32_t flags);
+
+/// Define a 2-Input Maximum Node and add it to a Subgraph.
+///
+/// The 2-Input Maximum Node computes elementwise maximum of two tensor inputs with numpy broadcasting rules.
+///
+/// @param subgraph - a Subgraph object that will own the created Node.
+/// @param input1_id - Value ID for the first input tensor. The input tensor must be an N-dimensional tensor defined in
+/// the @a subgraph with each dimension either equal to the corresponding dimension of the second
+/// input, or equal to 1. In the latter case, the elements of the input tensor are broadcasted along
+/// that dimension.
+/// @param input2_id - Value ID for the second input tensor. The input tensor must be an M-dimensional tensor defined in
+/// the @a subgraph with each dimension either equal to the corresponding dimension of the first
+/// input, or equal to 1. In the latter case, the elements of the input tensor are broadcasted along
+/// that dimension.
+/// @param output_id - Value ID for the output tensor. The output tensor must be a max(N,M)-dimensional tensor defined
+/// in the @a subgraph with each dimension equal to the maximum between the corresponding dimension
+/// of the two inputs.
+/// @param flags - binary features of the Maximum Node. No supported flags are currently defined.
+enum xnn_status xnn_define_maximum2(
+ xnn_subgraph_t subgraph,
+ uint32_t input1_id,
+ uint32_t input2_id,
+ uint32_t output_id,
+ uint32_t flags);
+
+/// Define a 2-Input Minimum Node and add it to a Subgraph.
+///
+/// The 2-Input Minimum Node computes elementwise minimum of two tensor inputs with numpy broadcasting rules.
+///
+/// @param subgraph - a Subgraph object that will own the created Node.
+/// @param input1_id - Value ID for the first input tensor. The input tensor must be an N-dimensional tensor defined in
+/// the @a subgraph with each dimension either equal to the corresponding dimension of the second
+/// input, or equal to 1. In the latter case, the elements of the input tensor are broadcasted along
+/// that dimension.
+/// @param input2_id - Value ID for the second input tensor. The input tensor must be an M-dimensional tensor defined in
+/// the @a subgraph with each dimension either equal to the corresponding dimension of the first
+/// input, or equal to 1. In the latter case, the elements of the input tensor are broadcasted along
+/// that dimension.
+/// @param output_id - Value ID for the output tensor. The output tensor must be a max(N,M)-dimensional tensor defined
+/// in the @a subgraph with each dimension equal to the maximum between the corresponding dimension
+/// of the two inputs.
+/// @param flags - binary features of the Minimum Node. No supported flags are currently defined.
+enum xnn_status xnn_define_minimum2(
+ xnn_subgraph_t subgraph,
+ uint32_t input1_id,
+ uint32_t input2_id,
+ uint32_t output_id,
+ uint32_t flags);
+
+/// Define a Squared Difference Node and add it to a Subgraph.
+///
+/// The Squared Difference Node computes elementwise squared difference of two tensor inputs with numpy broadcasting
+/// rules.
+///
+/// @param subgraph - a Subgraph object that will own the created Node.
+/// @param input1_id - Value ID for the first input tensor. The input tensor must be an N-dimensional tensor defined in
+/// the @a subgraph with each dimension either equal to the corresponding dimension of the second
+/// input, or equal to 1. In the latter case, the elements of the input tensor are broadcasted along
+/// that dimension.
+/// @param input2_id - Value ID for the second input tensor. The input tensor must be an M-dimensional tensor defined in
+/// the @a subgraph with each dimension either equal to the corresponding dimension of the first
+/// input, or equal to 1. In the latter case, the elements of the input tensor are broadcasted along
+/// that dimension.
+/// @param output_id - Value ID for the output tensor. The output tensor must be a max(N,M)-dimensional tensor defined
+/// in the @a subgraph with each dimension equal to the maximum between the corresponding dimension
+/// of the two inputs.
+/// @param flags - binary features of the Squared Difference Node. No supported flags are currently defined.
+enum xnn_status xnn_define_squared_difference(
+ xnn_subgraph_t subgraph,
+ uint32_t input1_id,
+ uint32_t input2_id,
+ uint32_t output_id,
+ uint32_t flags);
+
/// Define a Constant Pad Node with static padding specification and add it to a Subgraph.
///
/// @param subgraph - a Subgraph object that will own the created Node.