未验证 提交 4370a91a 编写于 作者: X Xiaoxu Chen 提交者: GitHub

reorganize the prim unittests struct (#49679)

上级 cfe55f31
......@@ -3,10 +3,10 @@ file(
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"test_*.py")
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
set(GC_ENVS FLAGS_eager_delete_tensor_gb=0.0)
foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${GC_ENVS})
endforeach()
add_subdirectory(api)
add_subdirectory(comp)
add_subdirectory(prim)
# Prim
Test composite and primitive API and related autodiff rules.
## Package Structure
- comp(abbr for composite):
Test composite API which is composed of primitive api, but not include the autodiff rules for primitive api.
- prim(abbr for primitive):
Test primitive api and autodiff rules.
- vjp: Test vjp rules.
- eager: Test vjp rules in eager mode.
- static: Test vjp rules in static mode.
- jvp(TODO): Test jvp rules.
## How to
- Forward API and First-rder Autodiff
Compare numerical value with raw phi operators using tools such as `np.testing.assert_allclose`
- Higher-order Autodiff
Compare numerical value with the result computed by finite difference. Tool
used for computing Higher-order finite difference will be provided in the future.
......@@ -3,7 +3,6 @@ file(
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"test_*.py")
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
set(GC_ENVS FLAGS_eager_delete_tensor_gb=0.0)
foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${GC_ENVS})
......
......@@ -3,11 +3,9 @@ file(
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"test_*.py")
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
set(GC_ENVS FLAGS_eager_delete_tensor_gb=0.0)
foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${GC_ENVS})
endforeach()
add_subdirectory(comp)
add_subdirectory(prim)
add_subdirectory(vjp)
......@@ -3,11 +3,10 @@ file(
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"test_*.py")
string(REPLACE ".py" "" TEST_OPS "${TEST_OPS}")
set(GC_ENVS FLAGS_eager_delete_tensor_gb=0.0)
foreach(TEST_OP ${TEST_OPS})
py_test_modules(${TEST_OP} MODULES ${TEST_OP} ENVS ${GC_ENVS})
endforeach()
add_subdirectory(eager_test)
add_subdirectory(static_test)
add_subdirectory(eager)
add_subdirectory(static)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册