mirror of
https://github.com/snowykami/mbcp.git
synced 2024-11-22 14:17:38 +08:00
✨ 新增函数柯里化功能
This commit is contained in:
parent
f136c1a9fc
commit
d027d4b862
@ -63,14 +63,7 @@ def get_partial_derivative_func(func: MultiVarsFunc, var: int | tuple[int, ...],
|
|||||||
# 内部函数不注释,以防止生成文档
|
# 内部函数不注释,以防止生成文档
|
||||||
if isinstance(var, int):
|
if isinstance(var, int):
|
||||||
def partial_derivative_func(*args: Var) -> Var:
|
def partial_derivative_func(*args: Var) -> Var:
|
||||||
"""
|
"""@litedoc-hide"""
|
||||||
@litedoc-hide
|
|
||||||
Args:
|
|
||||||
*args:
|
|
||||||
|
|
||||||
Returns:
|
|
||||||
|
|
||||||
"""
|
|
||||||
args_list_plus = list(args)
|
args_list_plus = list(args)
|
||||||
args_list_plus[var] += epsilon
|
args_list_plus[var] += epsilon
|
||||||
args_list_minus = list(args)
|
args_list_minus = list(args)
|
||||||
|
Loading…
Reference in New Issue
Block a user