diff options
author | Håvard Pettersen <havardpe@oath.com> | 2018-02-28 12:41:41 +0000 |
---|---|---|
committer | Håvard Pettersen <havardpe@oath.com> | 2018-02-28 12:41:41 +0000 |
commit | fa1f4c41ec36b8aa8867d6bb8540cd0bb3cced62 (patch) | |
tree | 92bcdebf538d358dd6f7dfa95ca7be3eb4fedb2c /eval/src | |
parent | 29b39068a3ffd22f906e72fdf2eedb9fe4d9d096 (diff) |
added 'result_is_mutable' predicate to tensor ir nodes
also updated class comment to better fit current reality
Diffstat (limited to 'eval/src')
-rw-r--r-- | eval/src/vespa/eval/eval/tensor_function.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/eval/src/vespa/eval/eval/tensor_function.h b/eval/src/vespa/eval/eval/tensor_function.h index 442e082d9d9..2c3e9d21e0b 100644 --- a/eval/src/vespa/eval/eval/tensor_function.h +++ b/eval/src/vespa/eval/eval/tensor_function.h @@ -26,8 +26,8 @@ class Tensor; /** * Interface used to describe a tensor function as a tree of nodes - * with information about operation sequencing and intermediate result - * types. Each node in the tree describes a single tensor + * with information about operation sequencing and intermediate + * results. Each node in the tree describes a single tensor * operation. This is the intermediate representation of a tensor * function. * @@ -38,10 +38,14 @@ class Tensor; * * The generic tree will then be optimized (in-place, bottom-up) where * sub-expressions may be replaced with optimized - * implementation-specific alternatives. + * implementation-specific alternatives. Note that multiple nodes in + * the original representation can be replaced with a single + * specialized node in the optimized tree. * * This leaves us with a mixed-mode tree with some generic and some - * specialized nodes, that may be evaluated recursively. + * specialized nodes. This tree will then be compiled into a sequence + * of instructions (each node will map to a single instruction) and + * evaluated in the context of an interpreted function. **/ struct TensorFunction { @@ -65,6 +69,7 @@ struct TensorFunction void set(const TensorFunction &child) const { ptr = &child; } }; virtual const ValueType &result_type() const = 0; + virtual bool result_is_mutable() const { return false; } /** * Push references to all children (NB: implementation must use |