code: def doall():
      global graph
      n = np.load("data/encryption.npy")
      n = np.transpose(n, (0, 3, 1, 2))
  
      # Compute the similarity between each encoded image and all others
      # This is n^2 work but should run fairly quickly, especially given
      # more than one GPU. Otherwise about an hour or so.
      graph = []
      with model.vars().replicate():
          for i in range(5000):
              print(i)
              v = model.predict_fast(
                  np.tile(n[i : i + 1], (5000, 1, 1, 1)), n
              )
              graph.append(np.array(v[:, 0] - v[:, 1]))
      graph = np.array(graph)
      np.save("data/graph.npy", graph)
  
file_path: privacy/research/instahide_attack_2020/step_1_create_graph.py
imports: import objax
  import numpy
  import jax.numpy
  import functools
  import os
  import random
  from objax.zoo import wide_resnet
label_desc: Use image node_id 2 for calling a global function with example usage: doall() without return types