Add math ops modules (#4629)
* add modules: - sum - mean - add - sub - mul - div - reciprocal * add +, -, *, / for tensor * add test case for add,div,mean,mul,reciprocal,sub,sum * refine test cases * refine sum module * remove useless oneflow_export for mean and sum * add tensor op test for mean and sum * add CrossEntropyLoss module * refine Sum * sum axis attr not found * refine sum * refine math ops * refien cross entropy loss * refine (not finished) * fix scalar div, sub * rename test Module name and refine test case * rename test Module name and refine test case * add neg method for Tensor * remove useless improt items * refine * reformat * remove useless dynamic attr * fix math_ops and loss * rename test * fix format * delete name * refine codes and format * style(*): format codes * fix(MathOp): fix merge bug Co-authored-by:simonJJJ <821898965@qq.com> Co-authored-by:
wyg1997 <wyg19970408@gmail.com> Co-authored-by:
oneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
Showing
- oneflow/python/framework/tensor.py 27 additions, 0 deletionsoneflow/python/framework/tensor.py
- oneflow/python/nn/modules/loss.py 88 additions, 0 deletionsoneflow/python/nn/modules/loss.py
- oneflow/python/nn/modules/math_ops.py 523 additions, 20 deletionsoneflow/python/nn/modules/math_ops.py
- oneflow/python/ops/math_ops.py 0 additions, 4 deletionsoneflow/python/ops/math_ops.py
- oneflow/python/test/modules/test_add.py 59 additions, 0 deletionsoneflow/python/test/modules/test_add.py
- oneflow/python/test/modules/test_avgpool2d.py 0 additions, 0 deletionsoneflow/python/test/modules/test_avgpool2d.py
- oneflow/python/test/modules/test_crossentropyloss.py 61 additions, 0 deletionsoneflow/python/test/modules/test_crossentropyloss.py
- oneflow/python/test/modules/test_div.py 65 additions, 0 deletionsoneflow/python/test/modules/test_div.py
- oneflow/python/test/modules/test_mean.py 39 additions, 0 deletionsoneflow/python/test/modules/test_mean.py
- oneflow/python/test/modules/test_mul.py 53 additions, 0 deletionsoneflow/python/test/modules/test_mul.py
- oneflow/python/test/modules/test_reciprocal.py 34 additions, 0 deletionsoneflow/python/test/modules/test_reciprocal.py
- oneflow/python/test/modules/test_sub.py 65 additions, 0 deletionsoneflow/python/test/modules/test_sub.py
- oneflow/python/test/modules/test_sum.py 51 additions, 0 deletionsoneflow/python/test/modules/test_sum.py
- oneflow/python/test/tensor/test_tensor.py 91 additions, 0 deletionsoneflow/python/test/tensor/test_tensor.py
Please register or sign in to comment