code: def __init__(
      self,
      softmax_batch_size=512,
      clip_score_batch_size=512,
      path="https://openaipublic.blob.core.windows.net/consistency/inception/inception-2015-12-05.pt",
  ):
      import clip
  
      super().__init__()
  
      self.softmax_batch_size = softmax_batch_size
      self.clip_score_batch_size = clip_score_batch_size
      self.inception = InceptionV3()
      with bf.BlobFile(path, "rb") as f:
          self.inception.load_state_dict(torch.load(f))
      self.inception.eval()
      self.inception.to(dist_util.dev())
  
      self.inception_softmax = self.inception.create_softmax_model()
  
      if dist.get_rank() % 8 == 0:
          clip_model, self.clip_preproc_fn = clip.load(
              "ViT-B/32", device=dist_util.dev()
          )
      dist.barrier()
      if dist.get_rank() % 8 != 0:
          clip_model, self.clip_preproc_fn = clip.load(
              "ViT-B/32", device=dist_util.dev()
          )
      dist.barrier()
  
      # Compute the probe features separately from the final projection.
      class ProjLayer(nn.Module):
          def __init__(self, param):
              super().__init__()
              self.param = param
  
          def forward(self, x):
              return x @ self.param
  
      self.clip_visual = clip_model.visual
      self.clip_proj = ProjLayer(self.clip_visual.proj)
      self.clip_visual.proj = None
  
      class TextModel(nn.Module):
          def __init__(self, clip_model):
              super().__init__()
              self.clip_model = clip_model
  
          def forward(self, x):
              return self.clip_model.encode_text(x)
  
      self.clip_tokenizer = lambda captions: clip.tokenize(
          captions, truncate=True
      )
      self.clip_text = TextModel(clip_model)
      self.clip_logit_scale = clip_model.logit_scale.exp().item()
      self.ref_features = {}
      self.is_root = not dist.is_initialized() or dist.get_rank() == 0
  
imports: from .inception_v3 import InceptionV3
  import blobfile
  import torch
  import torch.distributed
  import torch.nn
  from cm import dist_util
  import numpy
  import warnings
  from scipy import linalg
  from PIL import Image
  from tqdm import tqdm
label_desc: Use image node_id 1 to create a new FIDAndIS object  with example: obj = FIDAndIS(softmax_batch_size, clip_score_batch_size, path)