anirudhacharya commented on a change in pull request #9892: [WIP] Serde Module 
for Import/Export of models between Onnx and Mxnet
URL: https://github.com/apache/incubator-mxnet/pull/9892#discussion_r171135545
 
 

 ##########
 File path: python/mxnet/contrib/serde/_import/backend.py
 ##########
 @@ -0,0 +1,131 @@
+# Copyright 2017 Amazon.com, Inc. or its affiliates. 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.
+# A copy of the License is located at
+#     http://www.apache.org/licenses/LICENSE-2.0
+# or in the "license" file accompanying this file. This file 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.
+
+# coding: utf-8
+# pylint: disable=too-many-locals,invalid-name
+"""backend wrapper for onnx test infrastructure"""
+from collections import namedtuple
+from onnx.backend.base import Backend
+from .import_onnx import GraphProto
+from .backend_rep import MXNetBackendRep
+from .... import context
+from .... import module
+from .... import ndarray as nd
+
+# Using these functions for onnx test infrastructure.
+# Implemented by following onnx docs guide:
+# 
https://github.com/onnx/onnx/blob/master/docs/Implementing%20an%20ONNX%20backend.md
+# MXNetBackend class will take an ONNX model with inputs, perform a 
computation,
+# and then return the output.
+
+class MXNetBackend(Backend):
+    """MXNet backend for ONNX"""
 
 Review comment:
   This class is used by the onnx backend test framework here - 
https://github.com/anirudhacharya/incubator-mxnet/blob/serde/python/mxnet/contrib/serde/_import/tests/onnx_backend_test.py
   
   For testing the import functionality, we intend to use ONNX's backend test 
framework as described here - 
https://github.com/onnx/onnx/blob/master/docs/OnnxBackendTest.md 
   This is done to ensure that tests will be shared across different frameworks 
and that our module will be sync with onnx's standards and definition for 
various operators. This class will be used by the test framework to run 
operators on mxnet backend.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to