Skip to content

Commit ec9840a

Browse files
sayakpaulyiyixuxu
andauthored
[Refactor] harmonize the module structure for models in tests (#6738)
* harmonize the module structure for models in tests * make the folders modules. --------- Co-authored-by: YiYi Xu <[email protected]>
1 parent 093a03a commit ec9840a

15 files changed

+10
-10
lines changed

tests/models/autoencoders/__init__.py

Whitespace-only changes.

tests/models/test_models_vae.py renamed to tests/models/autoencoders/test_models_vae.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
)
4747
from diffusers.utils.torch_utils import randn_tensor
4848

49-
from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
49+
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin
5050

5151

5252
enable_full_determinism()

tests/models/test_models_vae_flax.py renamed to tests/models/autoencoders/test_models_vae_flax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from diffusers.utils import is_flax_available
55
from diffusers.utils.testing_utils import require_flax
66

7-
from .test_modeling_common_flax import FlaxModelTesterMixin
7+
from ..test_modeling_common_flax import FlaxModelTesterMixin
88

99

1010
if is_flax_available():

tests/models/test_models_vq.py renamed to tests/models/autoencoders/test_models_vq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
torch_device,
2626
)
2727

28-
from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
28+
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin
2929

3030

3131
enable_full_determinism()

tests/models/unets/__init__.py

Whitespace-only changes.

tests/models/test_models_unet_1d.py renamed to tests/models/unets/test_models_unet_1d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
torch_device,
2626
)
2727

28-
from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
28+
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin
2929

3030

3131
class UNet1DModelTests(ModelTesterMixin, UNetTesterMixin, unittest.TestCase):

tests/models/test_models_unet_2d.py renamed to tests/models/unets/test_models_unet_2d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
torch_device,
3131
)
3232

33-
from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
33+
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin
3434

3535

3636
logger = logging.get_logger(__name__)

tests/models/test_models_unet_2d_condition.py renamed to tests/models/unets/test_models_unet_2d_condition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
torch_device,
4949
)
5050

51-
from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
51+
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin
5252

5353

5454
logger = logging.get_logger(__name__)

tests/models/test_models_unet_3d_condition.py renamed to tests/models/unets/test_models_unet_3d_condition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from diffusers.utils.import_utils import is_xformers_available
2424
from diffusers.utils.testing_utils import enable_full_determinism, floats_tensor, skip_mps, torch_device
2525

26-
from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
26+
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin
2727

2828

2929
enable_full_determinism()

tests/models/test_models_unet_motion.py renamed to tests/models/unets/test_models_unet_motion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
torch_device,
3131
)
3232

33-
from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
33+
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin
3434

3535

3636
logger = logging.get_logger(__name__)

tests/models/test_models_unet_spatiotemporal.py renamed to tests/models/unets/test_models_unet_spatiotemporal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
torch_device,
2929
)
3030

31-
from .test_modeling_common import ModelTesterMixin, UNetTesterMixin
31+
from ..test_modeling_common import ModelTesterMixin, UNetTesterMixin
3232

3333

3434
logger = logging.get_logger(__name__)

tests/pipelines/test_pipelines_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
torch_device,
3939
)
4040

41-
from ..models.test_models_vae import (
41+
from ..models.autoencoders.test_models_vae import (
4242
get_asym_autoencoder_kl_config,
4343
get_autoencoder_kl_config,
4444
get_autoencoder_tiny_config,

0 commit comments

Comments
 (0)