Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev add jvp jacobian hessian (#10412)
## 分支工作 添加jvp、jacobian、hessian、hvp、vhp接口到funcitional.py文件,添加测试代码到test_autograd_functional.py文件 ## 代码修改部分 1. \_construct_standard_basis_for(): 因fill_ 不支持 NonContiguous,将fill_赋值替换为循环赋值。 (#10394) 2. \_construct_standard_basis_for(): 函数参数tensors: Tuple[torch.Tensor, ...]的写法会导致循环导入torch,因此将后面的描述去掉,变为tensors 3. _grad_preprocess:因oneflow.torch没有is_sparse属性,只采用res.append(inp.view_as(inp))方式创建新tensor 4. _jacfwd: 删除vectorize情况的代码 5. 在test_autograd_functional.py文件中添加jvp、jacobian、hessian、hvp、vhp测试代码 ## 添加接口 ![1704862723128](https://github.com/Oneflow-Inc/oneflow/assets/49504565/8ca9cfa6-0f1c-425b-baa1-036335e3d3e1) --------- Co-authored-by: Wang Yi <53533850+marigoold@users.noreply.github.com> Co-authored-by: oneflow-ci-bot <ci-bot@oneflow.org>
- Loading branch information