class_docstr: Deep Video Compression composition class.
  
  This composes the Deep Video Compression Module of Lu (2019). It requires
  defining a motion estimator, a motion autoencoder, a motion compensator,
  and a residual autoencoder. The individual modules can be input by the
  user. If the user does not input a module, then this class will construct
  the module with default parameters from the paper.
  
  Lu, Guo, et al. "DVC: An end-to-end deep video compression framework."
  CVPR (2019).
  
  Args:
      coder_channels: Number of channels to use for autoencoders.
      motion_estimator: A module for estimating motion. See
          ``DVCPyramidFlowEstimator`` for an example.
      motion_encoder: A module for encoding motion fields. See
          ``DVCCompressionEncoder`` for an example.
      motion_entropy_bottleneck: A module for quantization and latent
          probability estimation for the compressed motion fields. See
          ``EntropyBottleneck`` for an example.
      motion_decoder: A module for decoding motion fields. See
          ``DVCCompressionDecoder`` for an example.
      motion_compensation: A module for compensating for motion errors. See
          ``DVCMotionCompensationModel`` for an example.
      residual_encoder: A module for encoding residuals after motion
          compensation. See ``DVCCompressionEncoder`` with 3 input channels
          for an example.
      residual_entropy_bottleneck: A module for quantization and latent
          probability estimation for the compressed residuals. See
          ``EntropyBottleneck`` for an example.
      residual_decoder: A module for decoding residuals. See
          ``DVCCompressionEncoder`` with 3 output channels for an example.
class_docstr_tok: ["Deep","Video","Compression","composition","class",".","This","composes","the","Deep","Video","Compression","Module","of","Lu","(","2019",")",".","It","requires","defining","a","motion","estimator",",","a","motion","autoencoder",",","a","motion","compensator",",","and","a","residual","autoencoder",".","The","individual","modules","can","be","input","by","the","user",".","If","the","user","does","not","input","a","module",",","then","this","class","will","construct","the","module","with","default","parameters","from","the","paper",".","Lu",",","Guo",",","et","al",".","``","DVC",":","An","end-to-end","deep","video","compression","framework",".","''","CVPR","(","2019",")",".","Args",":","coder_channels",":","Number","of","channels","to","use","for","autoencoders",".","motion_estimator",":","A","module","for","estimating","motion",".","See","``","DVCPyramidFlowEstimator","``","for","an","example",".","motion_encoder",":","A","module","for","encoding","motion","fields",".","See","``","DVCCompressionEncoder","``","for","an","example",".","motion_entropy_bottleneck",":","A","module","for","quantization","and","latent","probability","estimation","for","the","compressed","motion","fields",".","See","``","EntropyBottleneck","``","for","an","example",".","motion_decoder",":","A","module","for","decoding","motion","fields",".","See","``","DVCCompressionDecoder","``","for","an","example",".","motion_compensation",":","A","module","for","compensating","for","motion","errors",".","See","``","DVCMotionCompensationModel","``","for","an","example",".","residual_encoder",":","A","module","for","encoding","residuals","after","motion","compensation",".","See","``","DVCCompressionEncoder","``","with","3","input","channels","for","an","example",".","residual_entropy_bottleneck",":","A","module","for","quantization","and","latent","probability","estimation","for","the","compressed","residuals",".","See","``","EntropyBottleneck","``","for","an","example",".","residual_decoder",":","A","module","for","decoding","residuals",".","See","``","DVCCompressionEncoder","``","with","3","output","channels","for","an","example","."]
code: def __init__(
      self,
      coder_channels: int = 128,
      motion_estimator: Optional[nn.Module] = None,
      motion_encoder: Optional[nn.Module] = None,
      motion_entropy_bottleneck: Optional[nn.Module] = None,
      motion_decoder: Optional[nn.Module] = None,
      motion_compensation: Optional[nn.Module] = None,
      residual_encoder: Optional[nn.Module] = None,
      residual_entropy_bottleneck: Optional[nn.Module] = None,
      residual_decoder: Optional[nn.Module] = None,
  ):
      super().__init__()
  
      self.motion_estimator = (
          DVCPyramidFlowEstimator()
          if motion_estimator is None
          else motion_estimator
      )
      self.motion_encoder = (
          DVCCompressionEncoder(
              filter_channels=coder_channels,
              out_channels=coder_channels,
          )
          if motion_encoder is None
          else motion_encoder
      )
      self.motion_entropy_bottleneck = (
          EntropyBottleneck(coder_channels)
          if motion_entropy_bottleneck is None
          else motion_entropy_bottleneck
      )
      self.motion_decoder = (
          DVCCompressionDecoder(
              in_channels=coder_channels, filter_channels=coder_channels
          )
          if motion_decoder is None
          else motion_decoder
      )
      self.motion_compensation = (
          DVCMotionCompensationModel()
          if motion_compensation is None
          else motion_compensation
      )
      self.residual_encoder = (
          DVCCompressionEncoder(
              in_channels=3,
              filter_channels=coder_channels,
              out_channels=coder_channels,
              kernel_size=5,
          )
          if residual_encoder is None
          else residual_encoder
      )
      self.residual_entropy_bottleneck = (
          EntropyBottleneck(coder_channels)
          if residual_entropy_bottleneck is None
          else residual_entropy_bottleneck
      )
      self.residual_decoder = (
          DVCCompressionDecoder(
              in_channels=coder_channels,
              filter_channels=coder_channels,
              out_channels=3,
              kernel_size=5,
          )
          if residual_decoder is None
          else residual_decoder
      )
  
imports: from typing import Any, List, NamedTuple, Optional, Sequence, Tuple
  import torch
  import torch.nn.functional
  from compressai.entropy_models import EntropyBottleneck
  from torch import Tensor, nn
  import neuralcompression.functional
  from neuralcompression.layers import SimplifiedGDN, SimplifiedInverseGDN
label_desc: Use image node_id 1 to create a new DVC object from inherited base classes: nn with example: obj = DVC(coder_channels, motion_estimator, motion_encoder, motion_entropy_bottleneck, motion_decoder, motion_compensation, residual_encoder, residual_entropy_bottleneck, residual_decoder)