class_docstr: Subclass of `Pickler` that strips unnecessary attributes from PyTensor objects.
  
  Example
  -------
  
  ..code-block:: python
  
      fn_args = dict(inputs=inputs,
                     outputs=outputs,
                     updates=updates)
      dest_pkl = 'my_test.pkl'
      with open(dest_pkl, 'wb') as f:
          strip_pickler = StripPickler(f, protocol=-1)
          strip_pickler.dump(fn_args)
class_docstr_tok: ["Subclass","of","`","Pickler","`","that","strips","unnecessary","attributes","from","PyTensor","objects",".","Example","--","--","--","-","..","code-block",":",":","python","fn_args","=","dict","(","inputs=inputs",",","outputs=outputs",",","updates=updates",")","dest_pkl","=","'my_test.pkl'","with","open","(","dest_pkl",",","'wb","'",")","as","f",":","strip_pickler","=","StripPickler","(","f",",","protocol=-1",")","strip_pickler.dump","(","fn_args",")"]
code: def __init__(self, file, protocol=0, extra_tag_to_remove=None):
      # Can't use super as Pickler isn't a new style class
      super().__init__(file, protocol)
      self.tag_to_remove = ["trace", "test_value"]
      if extra_tag_to_remove:
          self.tag_to_remove.extend(extra_tag_to_remove)
  
imports: import os
  import pickle
  import sys
  import tempfile
  import zipfile
  from collections import defaultdict
  from contextlib import closing
  from io import BytesIO
  from pickle import HIGHEST_PROTOCOL
  import numpy
  import pytensor
  from pytensor.compile.sharedvalue import SharedVariable
label_desc: Use image node_id 1 to create a new StripPickler object from inherited base classes: Pickler with example: obj = StripPickler(file, protocol, extra_tag_to_remove)