diff options
author | Kevin Petit <kevin.petit@arm.com> | 2023-05-16 09:08:48 +0100 |
---|---|---|
committer | Kevin Petit <kevin.petit@arm.com> | 2023-05-24 09:45:01 +0100 |
commit | 5333c25baaf4fe136ed45edd6521dc7a2a5de851 (patch) | |
tree | 8f132429aabe8a3e6f1ef89414c1dd933164d95b /chapters/operators.adoc | |
parent | 277a4f17f13ac882075e109c339cdeda03f8eedd (diff) | |
download | specification-5333c25baaf4fe136ed45edd6521dc7a2a5de851.tar.gz |
Formalise the description of operator argument types
- Standardise the terminology for operator arguments. Argument,
Operand, and Parameter were used interchangeably.
- Introduce a templatized tensor_t<> type for tensor arguments.
Scalars are represented by rank-0 tensors.
- Types can be checked with the XSD schema.
Signed-off-by: Kevin Petit <kevin.petit@arm.com>
Change-Id: Ic57b9387950824e994c5e7f9ec1489c29159b974
Diffstat (limited to 'chapters/operators.adoc')
-rw-r--r-- | chapters/operators.adoc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/chapters/operators.adoc b/chapters/operators.adoc index 897ff17..3a4c831 100644 --- a/chapters/operators.adoc +++ b/chapters/operators.adoc @@ -9,14 +9,23 @@ == Operators -=== Operator Parameters +=== Operator Arguments -An operator processes input operands to produce output operands. An operator can have three types of parameters: +Operators process input arguments to produce output arguments. +Their behavior can be configured using attribute arguments. +Arguments may have one of the following types: -* An input operand. This must be a tensor or a list of tensors and data is read by the operation. -* An output operand. This must be a tensor or a list of tensors and data is written by the operation. -* An attribute. This is a parameter that is constant for a particular instance of the operator. It may have any data type supported by TOSA. It is expected to be set at compile time. +* `tensor_t<element_type>`, abbreviated `T<element_type>`, represents a tensor whose elements are of type `element_type` where `element_type` can be any of the data types supported in TOSA. +* `tensor_list_t` represents a list of tensors. When lists are homogeneous, i.e. contain tensors of the same type, their type is further qualified as follows: `tensor_list_t<T<element_type>>`. +* `tosa_graph_t` represents a TOSA graph (see <<operator-graphs>>). +Arguments belong to one of three categories: Input, Output, or Attribute. The category to which an argument belongs further constrains its type: + +* An Input argument must be a tensor or a list of tensors used to provide the data read by the operation. +* An Output argument must be a tensor or a list of tensors into which the data produced by the operation is written. +* An Attribute argument is constant, i.e. its value is known at compilation time. It may have any data type supported by TOSA. + +[[operator-graphs]] === Operator Graphs A TOSA graph is a collection of TOSA operators where: @@ -27,7 +36,7 @@ A TOSA graph is a collection of TOSA operators where: * The attributes must be in the valid range permitted for the operator * The tensor dimensions must be in the valid range permitted for the operator -Some operators, such as control flow operators, take a graph of other operators as an attribute. The type tosa_graph_t will denote a graph of operators and the following functions define the tensor shape list for the graph input and outputs: +Some operators, such as control flow operators, take a graph of other operators as an attribute. The type `tosa_graph_t` will denote a graph of operators and the following functions define the tensor shape list for the graph input and outputs: [source,c++] ---- |