You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2017/12/10 03:09:18 UTC

[GitHub] II-Matto opened a new issue #9012: Implementing New Operators

II-Matto opened a new issue #9012: Implementing New Operators
URL: https://github.com/apache/incubator-mxnet/issues/9012
 
 
   I would like to implement a new operator with MXNet, and the operator is already implemented with Caffe. What is the easiest way to port my Caffe implementation to MXNet?
   
   The comment https://github.com/apache/incubator-mxnet/issues/7652#issuecomment-325894475 says that it is easier to implement complex operators using the legacy interface. But will the **legacy interface** be unsupported in the future? If it is OK to use the legacy interface, can someone provide links to some **comprehensive tutorials or examples**?
   
   -------
   
   To use the new nnvm interface for defining operators, I read this document: [A Beginner's Guide to Implementing Operators in MXNet Backend](https://github.com/apache/incubator-mxnet/blob/master/docs/how_to/add_op_in_backend.md). The step-by-step explanations are clear and I have understood the general pipeline of defining a new operator, but there still seems to be some obstacles in the way.
   
   1. How can I define **_variables storing intermediate results_** which can be used in both forward and backward computations? These variables will act like class member variables (assuming the operator is defined as a class). This is similar to the question in the comment https://github.com/apache/incubator-mxnet/issues/7652#issuecomment-338910634.
   2. How can I define a _**operator with learnable parameters**_ (e.g. convolution operator)? The current implementations of operators such as convolution seem to use a different (and legacy) interface. And the [tensor examples](https://github.com/apache/incubator-mxnet/tree/master/src/operator/tensor) are all parameter-free operators like dot product.
   3. Where can I find _**explanations of the various macros**_ to be used in operator definitions? The many macros are very confusing and it is hard for me to determine when I should use what and how. It would be very helpful if some templates for typical usages can be provided and explained.
   4. How can I **_correctly reference the headers_** in [src/operator](https://github.com/apache/incubator-mxnet/tree/master/src/operator), if I put my operator definition files in an independent directory outside MXNet? Many source files simply use relative paths, e.g. `#include #include "../mxnet_op.h"` and `#include "../mshadow_op.h"`, which are not suitable if a file is located outside MXNet directories.
   5. How can I **_specify multiple paths for the_** `EXTRA_OPERATORS` in  [config.mk](https://github.com/apache/incubator-mxnet/blob/master/make/config.mk)? After checking the [Makefile](https://github.com/apache/incubator-mxnet/blob/master/Makefile) and [CMakeLists.txt](https://github.com/apache/incubator-mxnet/blob/master/CMakeLists.txt), I find that only one path is supported (Please correct me if I am wrong).

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services