From 068e8ab5823b6147665d8c91354e51190b134238 Mon Sep 17 00:00:00 2001 From: kilinchange Date: Mon, 5 Aug 2024 17:05:44 +0800 Subject: [PATCH] fix: use std::nullopt as the default initial value for optional> --- ...45\344\275\234\344\270\232\344\273\213\347\273\215.md" | 8 ++++---- src/operators/matmul.cc | 2 +- src/operators/transpose.cc | 2 +- src/operators/unary.cc | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git "a/docs/\350\256\255\347\273\203\350\220\245\344\275\234\344\270\232\344\273\213\347\273\215.md" "b/docs/\350\256\255\347\273\203\350\220\245\344\275\234\344\270\232\344\273\213\347\273\215.md" index f3a1f7b..fa6b930 100644 --- "a/docs/\350\256\255\347\273\203\350\220\245\344\275\234\344\270\232\344\273\213\347\273\215.md" +++ "b/docs/\350\256\255\347\273\203\350\220\245\344\275\234\344\270\232\344\273\213\347\273\215.md" @@ -110,7 +110,7 @@ // REF: https://onnx.ai/onnx/operators/onnx__Transpose.html#transpose-21 // =================================== 作业 =================================== - return {{}}; + return std::nullopt; } ```` @@ -130,7 +130,7 @@ // TODO:返回经过 clip 操作后的 shape // REF: https://onnx.ai/onnx/operators/onnx__Clip.html#clip-13 // =================================== 作业 =================================== - return {{}}; + return std::nullopt; } ```` @@ -159,7 +159,7 @@ // TODO:返回经过 cast 操作后的 shape // REF: https://onnx.ai/onnx/operators/onnx__Cast.html#cast-21 // =================================== 作业 =================================== - return {{}}; + return std::nullopt; } ```` @@ -222,7 +222,7 @@ optional> MatmulObj::inferShape(const TensorVec &inputs) // TODO:返回经过 matmul 操作后的 shape // REF: https://github.com/onnx/onnx/blob/main/docs/Operators.md#gemm // =================================== 作业 =================================== - return {{}}; + return std::nullopt; } ```` diff --git a/src/operators/matmul.cc b/src/operators/matmul.cc index 0ce94a1..7a16ca2 100644 --- a/src/operators/matmul.cc +++ b/src/operators/matmul.cc @@ -27,7 +27,7 @@ namespace infini // TODO:返回经过 matmul 操作后的 shape // REF: https://github.com/onnx/onnx/blob/main/docs/Operators.md#gemm // =================================== 作业 =================================== - return {{}}; + return std::nullopt; } } // namespace infini \ No newline at end of file diff --git a/src/operators/transpose.cc b/src/operators/transpose.cc index f5e9659..faab2b6 100644 --- a/src/operators/transpose.cc +++ b/src/operators/transpose.cc @@ -34,7 +34,7 @@ namespace infini // REF: https://onnx.ai/onnx/operators/onnx__Transpose.html#transpose-21 // =================================== 作业 =================================== - return {{}}; + return std::nullopt; } std::string TransposeObj::toString() const diff --git a/src/operators/unary.cc b/src/operators/unary.cc index e773506..3daad36 100644 --- a/src/operators/unary.cc +++ b/src/operators/unary.cc @@ -39,7 +39,7 @@ namespace infini // TODO:返回经过 clip 操作后的 shape // REF: https://onnx.ai/onnx/operators/onnx__Clip.html#clip-13 // =================================== 作业 =================================== - return {{}}; + return std::nullopt; } std::string ClipObj::toString() const @@ -75,7 +75,7 @@ namespace infini // TODO:返回经过 cast 操作后的 shape // REF: https://onnx.ai/onnx/operators/onnx__Cast.html#cast-21 // =================================== 作业 =================================== - return {{}}; + return std::nullopt; } std::string CastObj::toString() const