Commit graph

18 commits

Author SHA1 Message Date
Laurent 6d599d53fd beautify EXPECTED_TREE in test_chain.py 2024-02-08 15:09:47 +01:00
Pierre Chapuis 471ef91d1c make __getattr__ on Module return object, not Any
PyTorch chose to make it Any because they expect its users' code
to be "highly dynamic": https://github.com/pytorch/pytorch/pull/104321

It is not the case for us, in Refiners having untyped code
goes contrary to one of our core principles.

Note that there is currently an open PR in PyTorch to
return `Module | Tensor`, but in practice this is not always
correct either: https://github.com/pytorch/pytorch/pull/115074

I also moved Residuals-related code from SD1 to latent_diffusion
because SDXL should not depend on SD1.
2024-02-06 11:32:18 +01:00
Pierre Chapuis f43a530254 add extra tests for Chain 2024-02-01 16:17:07 +01:00
Pierre Chapuis bba478abf2 create test_module 2024-02-01 16:17:07 +01:00
Pierre Chapuis ce0339b4cc add a get_path helper to modules 2024-01-26 19:31:13 +01:00
Colle dba9065229
fix test_debug_print
Follow-up of #173
2024-01-12 18:32:22 +01:00
Cédric Deltheil 792a0fc3d9 run lint rules using latest isort settings 2023-12-11 11:58:43 +01:00
Benjamin Trom 0024191c58 improve debug print for chains 2023-10-10 15:25:09 +02:00
Benjamin Trom a663375dc7 prevent setattr pytorch module to register on the Chain class 2023-10-10 14:46:15 +02:00
Cédric Deltheil d72e1d3478 chain: add insert_before_type 2023-09-25 13:54:26 +02:00
Pierre Chapuis d311f779c0 test all chain manipulation methods 2023-08-23 17:49:59 +02:00
Pierre Chapuis beacfe816b reordering (match chain.py order) 2023-08-23 17:49:59 +02:00
Pierre Chapuis e05c410a86 split test in two 2023-08-23 17:49:59 +02:00
Pierre Chapuis 337d2aea58 cosmetics 2023-08-23 17:49:59 +02:00
Pierre Chapuis a0c70ba7aa add a test for StopIteration in walk 2023-08-23 12:15:56 +02:00
Pierre Chapuis dec0d64432 make walk and layers not recurse by default
There is now a parameter to get the old (recursive) behavior.
2023-08-23 12:15:56 +02:00
Benjamin Trom 8c7298f8cc fix chain slicing with structural copy 2023-08-22 11:44:11 +02:00
Cédric Deltheil 48f674c433 initial commit 2023-08-04 15:28:41 +02:00