misc.pkl_utils - Tools for serialization.#

class pytensor.misc.pkl_utils.StripPickler(file, protocol=0, extra_tag_to_remove=None)[source]#

Subclass of Pickler that strips unnecessary attributes from PyTensor objects.

Example

..code-block:: python

fn_args = {

“inputs”: inputs, “outputs”: outputs, “updates”: updates,

} dest_pkl = “my_test.pkl” with Path(dest_pkl).open(“wb”) as f:

strip_pickler = StripPickler(f, protocol=-1) strip_pickler.dump(fn_args)