From 0f5d274e83b67fa240cbc48274dc57a23bceb625 Mon Sep 17 00:00:00 2001 From: YdrMaster Date: Fri, 1 Dec 2023 17:14:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E7=A7=AF=E7=B4=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: YdrMaster --- src/01graph_topo/include/graph_topo/linked_graph.hpp | 8 ++++---- src/07onnx/src/operators/clip.cc | 10 +++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/01graph_topo/include/graph_topo/linked_graph.hpp b/src/01graph_topo/include/graph_topo/linked_graph.hpp index adb9c58fb..1793034d1 100644 --- a/src/01graph_topo/include/graph_topo/linked_graph.hpp +++ b/src/01graph_topo/include/graph_topo/linked_graph.hpp @@ -56,8 +56,8 @@ namespace refactor::graph_topo { TN const &info() const; std::vector> const &inputs() const; std::vector> const &outputs() const; - std::unordered_set> const &predecessors() const; - std::unordered_set> const &successors() const; + std::unordered_set> predecessors() const; + std::unordered_set> successors() const; void connect(count_t, Rc); void disconnect(count_t); void reconnect(Rc, Rc); @@ -253,7 +253,7 @@ namespace refactor::graph_topo { return _outputs; } - LINKED_GRAPH_FN Node::predecessors() const->std::unordered_set> const & { + LINKED_GRAPH_FN Node::predecessors() const->std::unordered_set> { std::unordered_set> ans; for (auto const &e : _inputs) { if (e->_source) { @@ -263,7 +263,7 @@ namespace refactor::graph_topo { return ans; } - LINKED_GRAPH_FN Node::successors() const->std::unordered_set> const & { + LINKED_GRAPH_FN Node::successors() const->std::unordered_set> { std::unordered_set> ans; for (auto const &e : _outputs) { for (auto const &[n, _] : e->_targets) { diff --git a/src/07onnx/src/operators/clip.cc b/src/07onnx/src/operators/clip.cc index 822a28d28..c3896565d 100644 --- a/src/07onnx/src/operators/clip.cc +++ b/src/07onnx/src/operators/clip.cc @@ -1,6 +1,7 @@ #include "clip.hh" #include "common.h" #include "computation/operators/clip.h" +#include "computation/operators/identity.h" namespace refactor::onnx { using Op = Clip; @@ -33,9 +34,12 @@ namespace refactor::onnx { return Ok(Tensors{Tensor::share(input.dataType, input.shape, extractDependency(inputs))}); } - auto Op::lower(TensorRefs) const -> computation::OpBox { - using Op_ = computation::Clip; - return std::make_unique(); + auto Op::lower(TensorRefs inputs) const -> computation::OpBox { + if (inputs.size() > 1) { + return std::make_unique(); + } else { + return std::make_unique(); + } } }// namespace refactor::onnx