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 2019/10/31 05:19:59 UTC

[GitHub] [incubator-mxnet] reminisce commented on a change in pull request #16660: [WIP] [Numpy] TVM implementation for binary ops

reminisce commented on a change in pull request #16660: [WIP] [Numpy] TVM implementation for binary ops
URL: https://github.com/apache/incubator-mxnet/pull/16660#discussion_r340963837
 
 

 ##########
 File path: contrib/tvmop/core/umath.py
 ##########
 @@ -120,3 +121,327 @@ def _compute_binary_scalar_logic(op, dtype, ndim):
           **_bin_scalar_logic_cpu_attrs)(_binary_logic_cpu)
     defop(name='{}_gpu'.format(op_name), op=op_name,
           **_bin_scalar_logic_gpu_attrs)(_binary_logic_gpu)
+
+
+_bin_cpu_attrs_base = {
+    'target': 'cpu',
+    'dtype': AllTypes,
+    'ndim': [5],
+    'req': ['kWriteTo', 'kAddTo'],
+    'attrs': ['req'],
+}
+
+_bin_gpu_attrs_base = {
+    'target': 'gpu',
+    'dtype': ["float32", "float64", "uint8", "int8", "int32", "int64"],
+    'ndim': [5],
+    'req': ['kWriteTo', 'kAddTo'],
+    'attrs': ['req'],
+}
+
+def _binary_cpu(compute_func, op, dtype, ndim, req):
+    s, a, b, old, new = compute_func(op, dtype, ndim, req)
 
 Review comment:
   I think this makes sense since some op's backward function may use the forward function of another op.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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