Skip to content

Commit

Permalink
fix: filter out leaf but abstract class
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroIshida committed Sep 4, 2022
1 parent 6de89c7 commit 73c4dd6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/unittest/test_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import numpy as np
import torch

from mohou.utils import splitting_slices
from mohou.model.autoencoder import AutoEncoder, AutoEncoderBase, VariationalAutoEncoder
from mohou.utils import get_all_concrete_leaftypes, splitting_slices


def test_splitting_slicers():
Expand All @@ -24,3 +25,9 @@ def test_splitting_slicers():

assert obj3[0][0][0] == 6
assert obj3[-1][0][0] == 9


def test_get_all_concreate_leaftypes():
types = get_all_concrete_leaftypes(AutoEncoderBase)
print(types)
assert set(types) == set([AutoEncoder, VariationalAutoEncoder])

0 comments on commit 73c4dd6

Please sign in to comment.