Added support for python copy (#335)

* Added support for python copy

* precommit changes

* removed `_compiled_call_impl` line

* added tests and suggested changes

* ACK changes
This commit is contained in:
toji
2024-01-04 10:29:40 +05:30
committed by GitHub
parent 0d31128a44
commit d2467c320d
3 changed files with 20 additions and 0 deletions

View File

@@ -530,3 +530,9 @@ class Module(dict):
See :func:`train`.
"""
self.train(False)
def __getstate__(self):
return self.__dict__.copy()
def __setstate__(self, state):
self.__dict__.update(state)