parameters: (qconfig: Optional[QConfig],
                           mod: torch.nn.Module)
docstring: Verifies that this `qconfig` is valid.
docstring_summary: Verifies that this `qconfig` is valid.
docstring_tokens: Verifies that this qconfig is valid .
function: def assert_valid_qconfig(qconfig: Optional[QConfig],
                           mod: torch.nn.Module) -> None:
      """
      Verifies that this `qconfig` is valid.
      """
      if qconfig is None:
          return
      is_conv_transpose_mod = (
          isinstance(mod, torch.nn.ConvTranspose1d) or
          isinstance(mod, torch.nn.ConvTranspose2d) or
          isinstance(mod, torch.nn.ConvTranspose3d))
      if is_conv_transpose_mod:
          if qconfig.weight is None:
              # for now, we assume that any qconfig for ConvTranspose without a weight is valid
              return
          example_observer = qconfig.weight()
          is_per_channel = (
              isinstance(example_observer, torch.ao.quantization.PerChannelMinMaxObserver) or
              isinstance(example_observer, torch.ao.quantization.MovingAveragePerChannelMinMaxObserver)
          )
          assert not is_per_channel, \
              'Per channel weight observer is not supported yet for ConvTranspose{n}d.'
function_tokens: def assert_valid_qconfig ( qconfig : Optional [ QConfig ] , mod : torch . nn . Module ) -> None : if qconfig is None : return is_conv_transpose_mod = ( isinstance ( mod , torch . nn . ConvTranspose1d ) or isinstance ( mod , torch . nn . ConvTranspose2d ) or isinstance ( mod , torch . nn . ConvTranspose3d ) ) if is_conv_transpose_mod : if qconfig . weight is None : # for now, we assume that any qconfig for ConvTranspose without a weight is valid return example_observer = qconfig . weight ( ) is_per_channel = ( isinstance ( example_observer , torch . ao . quantization . PerChannelMinMaxObserver ) or isinstance ( example_observer , torch . ao . quantization . MovingAveragePerChannelMinMaxObserver ) ) assert not is_per_channel , 'Per channel weight observer is not supported yet for ConvTranspose{n}d.'