class_docstr: OASIS U-Net Discriminator with Context
  
  This class implements the U-Net Discriminator as documented in the
  following paper:
  
  You Only Need Adversarial Supervision for Semantic Image Synthesis
  V Sushko, E Schönfeld, D Zhang, J Gall, B Schiele, A Khoreva
  
  It includes upsampling path modifications to calculate the discriminator
  used in neural compression paper:
  
  Improving Statistical Fidelity for Neural Image Compression with Implicit
  Local Likelihood Models
  MJ Muckley, A El-Nouby, K Ullrich, H Jégou, J Verbeek
  
  Unlike the model used in the paper, this model can be clipped in its
  upsampling path by setting ``output_downsampling_factor''. For example,
  if you would like to clip the upsampling path at a 16 x 16 resolution for
  a 256 x 256 image, you should set ``output_downsampling_factor'' to 16.
  
  In addition to the features of ``UnetDiscriminator'', this class also
  allows the passing of contxt information as documented in the HiFiC paper
  for PatchGAN.
  
  Args:
      output_channels: Number of semantic classes or spatial label maps.
      output_downsampling_factor: The upsampling path should be clipped such
          that the output latent the original image resolution divided by
          this factor.
      context_in: Number of channels for the context.
      context_out: Number of channels for the initial context processing to
          output.
      chans: Channels for the U-Net. If none are passed, the default from the
          OASIS paper are used (``[3, 128, 128, 256, 256, 512, 512]'').
      norm_type: Type of normalization layer. One of ``('spectral',
          'instance', 'batch', 'identity')''.
class_docstr_tok: ["OASIS","U-Net","Discriminator","with","Context","This","class","implements","the","U-Net","Discriminator","as","documented","in","the","following","paper",":","You","Only","Need","Adversarial","Supervision","for","Semantic","Image","Synthesis","V","Sushko",",","E","Sch\u00f6nfeld",",","D","Zhang",",","J","Gall",",","B","Schiele",",","A","Khoreva","It","includes","upsampling","path","modifications","to","calculate","the","discriminator","used","in","neural","compression","paper",":","Improving","Statistical","Fidelity","for","Neural","Image","Compression","with","Implicit","Local","Likelihood","Models","MJ","Muckley",",","A","El-Nouby",",","K","Ullrich",",","H","J\u00e9gou",",","J","Verbeek","Unlike","the","model","used","in","the","paper",",","this","model","can","be","clipped","in","its","upsampling","path","by","setting","``","output_downsampling_factor","''",".","For","example",",","if","you","would","like","to","clip","the","upsampling","path","at","a","16","x","16","resolution","for","a","256","x","256","image",",","you","should","set","``","output_downsampling_factor","''","to","16",".","In","addition","to","the","features","of","``","UnetDiscriminator","''",",","this","class","also","allows","the","passing","of","contxt","information","as","documented","in","the","HiFiC","paper","for","PatchGAN",".","Args",":","output_channels",":","Number","of","semantic","classes","or","spatial","label","maps",".","output_downsampling_factor",":","The","upsampling","path","should","be","clipped","such","that","the","output","latent","the","original","image","resolution","divided","by","this","factor",".","context_in",":","Number","of","channels","for","the","context",".","context_out",":","Number","of","channels","for","the","initial","context","processing","to","output",".","chans",":","Channels","for","the","U-Net",".","If","none","are","passed",",","the","default","from","the","OASIS","paper","are","used","(","``","[","3",",","128",",","128",",","256",",","256",",","512",",","512","]","''",")",".","norm_type",":","Type","of","normalization","layer",".","One","of","``","(","'spectral","'",",","'instance","'",",","'batch","'",",","'identity","'",")","''","."]
code: def is_conditional(self) -> bool:
      return True
  
imports: import math
  from functools import partial
  from typing import Callable, List, Optional, Union
  import torch
  import torch.nn
  import torch.nn.functional
  from torch import Tensor
  from torch.nn.utils.parametrizations import spectral_norm
  from ._discriminator import Discriminator
label_desc: Use image node_id 2 for calling the ConditionalUnetDiscriminator obj's underlying member method code with example usage: obj.is_conditional() and returns: True