Check API will be used in codegen
Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
}
}
+bool TensorBuilder::isSubTensorOf(const graph::operand::Index &parent,
+ const graph::operand::Index &child)
+{
+ if (_subtensor_info_map.find(child) == _subtensor_info_map.end())
+ {
+ return false;
+ }
+
+ if (_subtensors.find(child) == _subtensors.end())
+ {
+ return false;
+ }
+
+ if (_subtensor_info_map.at(child).parent() != parent)
+ {
+ return false;
+ }
+
+ return true;
+}
+
} // namespace acl_cl
} // namespace backend
} // namespace neurun
virtual void iterate(const IterateFunction &fn) override;
std::shared_ptr<::arm_compute::ICLTensor> at(const ::neurun::graph::operand::Index &ind);
+ /**
+ * @brief Check child tensor is allocated as subtensor of parent tensor
+ * @param[in] parent Index of parent
+ * @param[in] child Index of child
+ * @return @c true if child is allocated as subtensor of parent, otherwise @c false
+ */
+ bool isSubTensorOf(const graph::operand::Index &parent, const graph::operand::Index &child);
private:
std::unordered_map<graph::operand::Index, ::arm_compute::TensorInfo> _tensor_info_map;