code: def forward(self, input, reverse=False):
      if reverse:
          return self.reverse(input)
      if len(input.shape) == 2:
          input = input[:, :, None, None]
          squeeze = True
      else:
          squeeze = False
  
      _, _, height, width = input.shape
  
      if self.training and self.initialized.item() == 0:
          self.initialize(input)
          self.initialized.fill_(1)
  
      h = self.scale * (input + self.loc)
  
      if squeeze:
          h = h.squeeze(-1).squeeze(-1)
  
      if self.logdet:
          log_abs = torch.log(torch.abs(self.scale))
          logdet = height * width * torch.sum(log_abs)
          logdet = logdet * torch.ones(input.shape[0]).to(input)
          return h, logdet
  
      return h
  
file_path: generative-models/sgm/modules/autoencoding/lpips/util.py
imports: import hashlib
  import os
  import requests
  import torch
  import torch.nn
  from tqdm import tqdm
label_desc: Use image node_id 3 for calling the ActNorm obj's underlying member method code with example usage: obj.forward(input, reverse) and returns: h, self, h,  logdet