-
Notifications
You must be signed in to change notification settings - Fork 11
Description
It's in- not "imcompatible":
and in the README "from/for pytorch", should be "from/to PyTorch"?
It's great to see this package (while seemingly you can always use PythonCall.jl, i.e. Python to load/store all pickles), i.e. not needing Python.
I tried to dig into the source code to check if an ordered Dict is used. I.e. Python at some point changed from unordered to ordered, so when you deserialize, an ordered (also unordered from older Python/pickle?) I think you want to return such a type, not Julia's (unordered) Dict, from Base. I see you depend on DataStructures.jl, maybe for that. An ordered type should be there, it's also in OrderedCollection.jl
It's a question what to do when you serialize (unordered) Julia Dict. Can and does/should it go to now default Python's ordered dict?
I don't know that I will ever need to serialize to pickle/PyTorch, while you want to support that, it seems maybe the main reason for this package is to deserialize Pickle, or rather PyTorch's .bin (that I suppose has all the same requirements and more).
I was sort of surprised to see "opcode". I realize in Python you can pickle anything even programs, so it's meant for, not the source code, rather Python's generated VM code? I'm not sure if it's used or useful for PyTorch, I only know the possibility makes it a security risk in Python that someone can serialize a supposed NN, with arbitrary Python executable code.
I suppose if you deserialize this code in Julia, you get the opcodes in some form, but no way to actually run them (yet), i.e. actually without the security risk? Is there ever a downside and you actually want to distribute code with and have it run on deserialization (in Python)? Are you planning then on supporting it (I guess not)? You might want to document this somehow either way, in a positive light... :)