File indexing completed on 2025-04-03 08:57:55
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include <memory>
0012 #include <string>
0013 namespace ONNX_NAMESPACE {
0014 namespace version_conversion {
0015
0016 class Upsample_9_10 final : public Adapter {
0017 public:
0018 explicit Upsample_9_10() : Adapter("Upsample", OpSetID(9), OpSetID(10)) {}
0019
0020 Node* adapt_upsample_9_10(std::shared_ptr<Graph> graph, Node* node) const {
0021 std::string mode = node->hasAttribute(kmode) ? node->s(kmode) : "nearest";
0022
0023
0024 Node* resize = graph->create(kResize);
0025 resize->s_(kmode, mode);
0026 resize->addInput(node->inputs()[0]);
0027 resize->addInput(node->inputs()[1]);
0028 node->replaceAllUsesWith(resize);
0029
0030 resize->insertBefore(node);
0031 node->destroy();
0032
0033 return resize;
0034 }
0035
0036 Node* adapt(std::shared_ptr<Graph> graph, Node* node) const override {
0037 return adapt_upsample_9_10(graph, node);
0038 }
0039 };
0040
0041 }
0042 }