class_docstr: Tests for cleverhans.serial
docstr: test_save_and_load_var: Test that we can save and load a
  PicklableVariable with joblib
docstr_tok: ["test_save_and_load_var",":","Test","that","we","can","save","and","load","a","PicklableVariable","with","joblib"]
code: def test_save_and_load_var(self):
      """test_save_and_load_var: Test that we can save and load a
      PicklableVariable with joblib
      """
      sess = tf.Session()
      with sess.as_default():
          x = np.ones(1)
          xv = PicklableVariable(x)
          xv.var.initializer.run()
          save("/tmp/var.joblib", xv)
          sess.run(tf.assign(xv.var, np.ones(1) * 2))
          new_xv = load("/tmp/var.joblib")
          self.assertClose(sess.run(xv.var), np.ones(1) * 2)
          self.assertClose(sess.run(new_xv.var), np.ones(1))
  
file_path: cleverhans/cleverhans_v3.1.0/tests_tf/test_serial.py
imports: import numpy
  import tensorflow
  from cleverhans.devtools.checks import CleverHansTest
  from cleverhans.serial import PicklableVariable
  from cleverhans.serial import load
  from cleverhans.serial import save
label_desc: Use image node_id 1 for calling the TestSerial obj's underlying member method code with example usage: obj.test_save_and_load_var() without return types