docstr: Permute a node's attributes. Somewhat hacky, assumes that we'll find exactly one dimension with a length matching the permutation's 
code: def permute_attr(
      cls, node_name, permutation_sequence, fx_graph, dryrun
  ):
      """Permute a node's attributes. Somewhat hacky, assumes that we'll find exactly one dimension with a length matching the permutation's"""
  
      assert "attr" in fx_graph[node_name].keys()
      attr = fx_graph[node_name]["attr"]
      if cls.__verbosity > 1:
          print(f"Found attribute {node_name} of shape {attr.shape}")
      found_perm = False
      for dim in range(len(attr.shape)):
          if attr.shape[dim] == len(permutation_sequence):
              if found_perm:
                  if cls.__verbosity > 0:
                      print(
                          f"\tWARNING: {node_name} has already been permuted, but it's trying to happen again along another dimension {dim}."
                      )
  
                  return False
  
              found_perm = True
              if cls.__verbosity > 1 and dryrun:
                  print(f"\tpermuting along dimension {dim}")
  
              if not dryrun:
                  # permute the dimension of interest to the front, permute within that dimension, then reset it
                  order = [c for c in range(len(attr.shape))]
                  order[0] = dim
                  order[dim] = 0
                  prmt = tuple(order)
  
                  temp_weight = torch.clone(attr)
                  temp_weight = torch.permute(temp_weight, prmt)
                  temp_weight.copy_(
                      temp_weight[permutation_sequence, ...]
                  )
                  temp_weight = torch.permute(temp_weight, prmt)
                  attr.data.copy_(temp_weight)
  
                  cls.__params_permuted_in_K.append(
                      node_name + "_" + str(dim)
                  )
  
      return found_perm
  
imports: import os
  import torch
  import json
  import string
  import time
  import numpy
  import sys
  import builtins
  import io
label_desc: Use image node_id 9 for calling the Permutation obj's underlying member method code with example usage: obj.permute_attr(cls, node_name, permutation_sequence, fx_graph, dryrun) and returns: found_perm, False