Skip to content

Commit

Permalink
ci: imporve test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangyi15 committed Feb 24, 2024
1 parent 4f1e840 commit 8326e87
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tf_pwa/tests/test_variable.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,25 @@ def test_rename():
assert vm.get("ci") == 3


def test_same():
with variable_scope() as vm:
Variable("a", value=1.0)
Variable("b", value=1.0)
Variable("c", value=1.0)
vm.set_same(["a", "b"])
vm.set_same(["b", "c"])
assert len(vm.trainable_vars) == 1


def test_fixed():
with variable_scope() as vm:
Variable("a", value=1.0)
Variable("b", value=1.0)
vm.set_fix("a", 1.0)
vm.set_fix("b", unfix=True)
assert len(vm.trainable_vars) == 1


def test_transform():
from tf_pwa.config_loader import ConfigLoader
from tf_pwa.transform import BaseTransform, register_trans
Expand Down

0 comments on commit 8326e87

Please sign in to comment.