You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by gi...@git.apache.org on 2017/08/25 03:31:23 UTC

[GitHub] reminisce commented on a change in pull request #7604: Refactor random linalg contrib namespaces

reminisce commented on a change in pull request #7604: Refactor random linalg contrib namespaces
URL: https://github.com/apache/incubator-mxnet/pull/7604#discussion_r135177950
 
 

 ##########
 File path: python/mxnet/base.py
 ##########
 @@ -359,3 +361,79 @@ def _as_list(obj):
         return obj
     else:
         return [obj]
+
+
+_OP_NAME_PREFIX_LIST = ['_contrib_', '_linalg_', '_random_', '_sparse_']
+
+
+def _get_op_name_prefix(op_name):
+    """
+    Check whether the given op_name starts with any words in `_OP_NAME_PREFIX_LIST`.
+    If found, return the prefix; else, return an empty string.
+    """
+    for prefix in _OP_NAME_PREFIX_LIST:
+        if op_name.startswith(prefix):
+            return prefix
+    return ""
+
+
+# pylint: enable=too-many-locals, invalid-name
+def _init_op_module(root_namespace, module_name, make_op_func):
 
 Review comment:
   I feel it doesn't fit in base either. Can you suggest one place that is accessible to both symbol/op.h and ndarray/op.h?
 
----------------------------------------------------------------
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