/* * Copyright (c) 2019 Samsung Electronics Co., Ltd. All Rights Reserved * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "CanonicalNodeConverter.h" #include #include namespace exo { template bool CanonicalNodeConverter::run(loco::Graph *graph) { auto active_nodes = loco::active_nodes(loco::output_nodes(graph)); bool changed = false; for (auto node : active_nodes) { if (node->dialect() == loco::CanonicalDialect::get()) { auto the_node = dynamic_cast(node); if (the_node != nullptr) { if (convert(the_node)) changed = true; } } } return changed; } // template instantiation template bool CanonicalNodeConverter::run(loco::Graph *graph); // TODO loco::ConstGen // TODO loco::Conv2D // TODO loco::DepthwiseConv2D // TODO loco::DepthwiseFilterEncode template bool CanonicalNodeConverter::run(loco::Graph *graph); // TODO loco::EltwiseDiv template bool CanonicalNodeConverter::run(loco::Graph *graph); // TODO loco::EltwiseSqrt // TODO loco::EltwiseSub template bool CanonicalNodeConverter::run(loco::Graph *graph); // TODO loco::FixedReshape template bool CanonicalNodeConverter::run(loco::Graph *graph); template bool CanonicalNodeConverter::run(loco::Graph *graph); // TODO loco::ReLU6 // TODO loco::Tanh // TODO loco::TensorConcat // TODO loco::TensorBiasAdd // NOTE TensorBroadcastConverter is skipped here as this directly inherits // loco::Pass instead of CanonicalNodeConverter // TODO loco::TensorSoftmax } // namespace exo