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/11/18 02:19:34 UTC

[GitHub] szha commented on a change in pull request #8701: add inline for cached op & fixed a bug when calling backward on variable

szha commented on a change in pull request #8701: add inline for cached op & fixed a bug when calling backward on variable
URL: https://github.com/apache/incubator-mxnet/pull/8701#discussion_r151825336
 
 

 ##########
 File path: python/mxnet/_ctypes/ndarray.py
 ##########
 @@ -105,10 +105,13 @@ def _imperative_invoke(handle, ndargs, keys, vals, out):
 class CachedOp(object):
     """Cached operator handle."""
     __slots__ = ["handle"]
-    def __init__(self, sym):
+    def __init__(self, sym, flags=()):
         self.handle = CachedOpHandle()
-        check_call(_LIB.MXCreateCachedOp(
+        check_call(_LIB.MXCreateCachedOpEx(
             sym.handle,
+            len(flags),
+            c_array(ctypes.c_char_p, [c_str(key) for key, _ in flags]),
 
 Review comment:
   ```
   flag_keys, flag_vals = zip(*flags)
   ...
   c_str_array(flag_keys),
   c_str_array(map(str, flag_vals)),
   ...
   ```

----------------------------------------------------------------
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