fix: add comments

This commit is contained in:
Zhang Bolun 2024-05-06 17:01:51 +08:00
parent 917e82e90c
commit 5862671c0c
2 changed files with 3 additions and 0 deletions

View File

@ -85,6 +85,7 @@ class OnnxStub:
while len(sorted_nodes) < len(model.graph.node): while len(sorted_nodes) < len(model.graph.node):
updated = False updated = False
for i, node in enumerate(model.graph.node): for i, node in enumerate(model.graph.node):
# TODO目前只考虑了resize算子输入为空的情况
if all(t in known_edge or t == "" for t in node.input): if all(t in known_edge or t == "" for t in node.input):
node.name = str(len(sorted_nodes)) + "_" + node.name node.name = str(len(sorted_nodes)) + "_" + node.name
sorted_nodes.append(i) sorted_nodes.append(i)

View File

@ -85,6 +85,8 @@ class ResizeCnnl : public BangKernelWithoutConfig {
cnnlCropAndResizeMode_t mode; cnnlCropAndResizeMode_t mode;
auto coefMode = op->getMode(); auto coefMode = op->getMode();
if (coefMode == ResizeObj::ECoeffMode::nearest) { if (coefMode == ResizeObj::ECoeffMode::nearest) {
// CNNL uses round by default and
// does not support other nearest modes
mode = CNNL_CROP_AND_RESIZE_NEAREST; mode = CNNL_CROP_AND_RESIZE_NEAREST;
} else if (coefMode == ResizeObj::ECoeffMode::linear) { } else if (coefMode == ResizeObj::ECoeffMode::linear) {
mode = CNNL_CROP_AND_RESIZE_BILINEAR; mode = CNNL_CROP_AND_RESIZE_BILINEAR;