Add copy user op (#4842)
* copy user op * add to module and tensor.to interface * remove unnecessary code * backward for tensor.to * remove capture of input * support cpu only tensor * module to (#4858) * remove backward kernel and op * friendly deal with when tensor.grad is None * minor fix * minor fix * revert * suport 1m1d only * skip test normalization * skip test normalization * skip conv * support construct device using string * minor fix * minor fix * use maybe * fix device id type for device infer ctx * skip batchnorm * skip some tensor test case Co-authored-by:Xiaoyu Xu <xiaoyulink@gmail.com> Co-authored-by:
oneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
Showing
- oneflow/api/python/framework/device.cpp 1 addition, 0 deletionsoneflow/api/python/framework/device.cpp
- oneflow/core/autograd/gradient_funcs/copy.cpp 65 additions, 0 deletionsoneflow/core/autograd/gradient_funcs/copy.cpp
- oneflow/core/eager/cuda_opkernel_instruction_type.cpp 26 additions, 0 deletionsoneflow/core/eager/cuda_opkernel_instruction_type.cpp
- oneflow/core/framework/infer_util.h 2 additions, 2 deletionsoneflow/core/framework/infer_util.h
- oneflow/core/framework/op_expr.cpp 2 additions, 2 deletionsoneflow/core/framework/op_expr.cpp
- oneflow/core/framework/op_expr_helper.cpp 13 additions, 0 deletionsoneflow/core/framework/op_expr_helper.cpp
- oneflow/core/framework/op_expr_helper.h 4 additions, 0 deletionsoneflow/core/framework/op_expr_helper.h
- oneflow/core/framework/op_interpreter/eager_mirrored_op_interpreter.cpp 1 addition, 4 deletions...ramework/op_interpreter/eager_mirrored_op_interpreter.cpp
- oneflow/python/framework/tensor.py 4 additions, 3 deletionsoneflow/python/framework/tensor.py
- oneflow/python/nn/module.py 10 additions, 0 deletionsoneflow/python/nn/module.py
- oneflow/python/nn/modules/to.py 41 additions, 0 deletionsoneflow/python/nn/modules/to.py
- oneflow/python/test/modules/test_batchnorm.py 2 additions, 4 deletionsoneflow/python/test/modules/test_batchnorm.py
- oneflow/python/test/modules/test_conv.py 2 additions, 4 deletionsoneflow/python/test/modules/test_conv.py
- oneflow/python/test/modules/test_normalization.py 2 additions, 5 deletionsoneflow/python/test/modules/test_normalization.py
- oneflow/python/test/modules/test_to.py 66 additions, 0 deletionsoneflow/python/test/modules/test_to.py
- oneflow/python/test/tensor/test_tensor.py 6 additions, 5 deletionsoneflow/python/test/tensor/test_tensor.py
- oneflow/user/kernels/copy_kernel.cpp 46 additions, 0 deletionsoneflow/user/kernels/copy_kernel.cpp
- oneflow/user/ops/copy_op.cpp 63 additions, 0 deletionsoneflow/user/ops/copy_op.cpp
oneflow/python/nn/modules/to.py
0 → 100644
oneflow/python/test/modules/test_to.py
0 → 100644
oneflow/user/kernels/copy_kernel.cpp
0 → 100644
oneflow/user/ops/copy_op.cpp
0 → 100644
Please register or sign in to comment