Skip to content

Commit

Permalink
CorrDiff: Remove pickle dependency (#445)
Browse files Browse the repository at this point in the history
* remove pickle

* Remove unused io library

---------

Co-authored-by: Kaustubh Tangsali <71059996+ktangsali@users.noreply.github.com>
  • Loading branch information
mnabian and ktangsali authored Apr 11, 2024
1 parent 0168c00 commit eff54e6
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

- Pickle dependency for CorrDiff.

### Fixed

- Consistent handling of single GPU runs in DistributedManager
Expand Down
1 change: 0 additions & 1 deletion modulus/utils/generative/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
get_obj_by_name,
get_obj_from_module,
get_top_level_function_name,
is_pickleable,
is_top_level_function,
list_dir_recursively_with_ignore,
named_params_and_buffers,
Expand Down
11 changes: 0 additions & 11 deletions modulus/utils/generative/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
import fnmatch
import importlib
import inspect
import io
import os
import pickle
import re
import shutil
import sys
Expand Down Expand Up @@ -209,15 +207,6 @@ def get_dtype_and_ctype(type_obj: Any) -> Tuple[np.dtype, Any]: # pragma: no co
return my_dtype, my_ctype


def is_pickleable(obj: Any) -> bool: # TODO remove # pragma: no cover
try:
with io.BytesIO() as stream:
pickle.dump(obj, stream)
return True
except:
return False


# Functionality to import modules/objects by name, and call functions by name
# -------------------------------------------------------------------------------------

Expand Down

0 comments on commit eff54e6

Please sign in to comment.