From 978269162aca7f6e80bd9082629866b8551071fb Mon Sep 17 00:00:00 2001 From: YdrMaster Date: Wed, 15 Mar 2023 14:48:39 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=20c++=20=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E4=B8=AD=E6=96=87=E6=B3=A8=E9=87=8A=EF=BC=8Cpython=20?= =?UTF-8?q?TODO=20=E6=94=B9=20FIXME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: YdrMaster --- pyinfinitensor/src/pyinfinitensor/onnx.py | 4 ++-- src/ffi/ffi_infinitensor.cc | 2 +- src/operators/reduce_mean.cc | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pyinfinitensor/src/pyinfinitensor/onnx.py b/pyinfinitensor/src/pyinfinitensor/onnx.py index 03b6866f..a429368f 100644 --- a/pyinfinitensor/src/pyinfinitensor/onnx.py +++ b/pyinfinitensor/src/pyinfinitensor/onnx.py @@ -63,7 +63,7 @@ def from_onnx(model: onnx.ModelProto): (alpha, beta, transA, transB) = ( attributes[name] for name in ["alpha", "beta", "transA", "transB"] ) - # TODO 不支持这些参数 + # FIXME 不支持 `alpha` `beta` assert alpha == 1.0 assert beta == 1.0 tensors[node.output[0]] = handler.matmul( @@ -226,7 +226,7 @@ def from_onnx(model: onnx.ModelProto): tensors.get(node.output[0]), ) elif node.op_type == "Flatten": - # TODO 后端算子不支持沿任意轴展开 + # FIXME 后端算子不支持沿任意轴展开 axis = next( (attr.i for attr in node.attribute if attr.name == "axis"), None ) diff --git a/src/ffi/ffi_infinitensor.cc b/src/ffi/ffi_infinitensor.cc index 9300cdb8..37b7d5da 100644 --- a/src/ffi/ffi_infinitensor.cc +++ b/src/ffi/ffi_infinitensor.cc @@ -30,7 +30,7 @@ void init_graph_builder(py::module &m) { m, "CpuRuntimeObj"); py::class_>(m, "TensorObj"); py::enum_(m, "ActType") - .value("Linear", ActType::None) // None 是 Python 关键字,不能用 + .value("Linear", ActType::None) // `None` is Python keyword .value("Relu", ActType::Relu) .value("Sigmoid", ActType::Sigmoid) .value("Tanh", ActType::Tanh) diff --git a/src/operators/reduce_mean.cc b/src/operators/reduce_mean.cc index 3a562abb..95e09dc5 100644 --- a/src/operators/reduce_mean.cc +++ b/src/operators/reduce_mean.cc @@ -6,8 +6,6 @@ ReduceMeanObj::ReduceMeanObj(GraphObj *graph, Tensor input, Tensor output, : OperatorObj(OpType::ReduceMean, {input}, {output}), keepDims(keepDims) { const auto size = input->getDims().size(); if (_axes) { - // TODO 不需要这个,但需要处理负数,一对相反数应该不能同时出现。 - // IT_ASSERT((*_axes).size() <= input->getDims().size()); for (auto idx : *_axes) { if (idx < 0) IT_TODO_HALT();