class_docstr: Conv-BN fusion implemented with explicit folding. Useful
  to verify numerical equivalency with non-folded version.
class_docstr_tok: ["Conv-BN","fusion","implemented","with","explicit","folding",".","Useful","to","verify","numerical","equivalency","with","non-folded","version","."]
docstr: Create a qat module from a float module or qparams_dict
  Args: `mod` a float module, either produced by torch.ao.quantization utilities
  or directly from user
docstr_tok: ["Create","a","qat","module","from","a","float","module","or","qparams_dict","Args",":","`","mod","`","a","float","module",",","either","produced","by","torch.ao.quantization","utilities","or","directly","from","user"]
code: def from_float(cls, mod, qconfig=None):
      r"""Create a qat module from a float module or qparams_dict
      Args: `mod` a float module, either produced by torch.ao.quantization utilities
      or directly from user
      """
      assert type(mod) == cls._FLOAT_MODULE, (
          "qat."
          + cls.__name__
          + ".from_float only works for "
          + cls._FLOAT_MODULE.__name__
      )
      if not qconfig:
          assert hasattr(
              mod, "qconfig"
          ), "Input float module must have qconfig defined"
          assert (
              mod.qconfig
          ), "Input float module must have a valid qconfig"
          qconfig = mod.qconfig
      conv, bn = mod[0], mod[1]
      qat_convbn = cls(
          conv.in_channels,
          conv.out_channels,
          conv.kernel_size,
          conv.stride,
          conv.padding,
          conv.dilation,
          conv.groups,
          conv.bias is not None,
          conv.padding_mode,
          bn.eps,
          bn.momentum,
          False,
          qconfig,
      )
      qat_convbn.weight = conv.weight
      qat_convbn.bias = conv.bias
      qat_convbn.gamma = bn.weight
      qat_convbn.beta = bn.bias
      qat_convbn.running_mean = bn.running_mean
      qat_convbn.running_var = bn.running_var
      qat_convbn.num_batches_tracked = bn.num_batches_tracked
      return qat_convbn
  
imports: import copy
  import math
  import torch
  import torch.nn
  import torch.backends.mkldnn
  from torch.nn import Conv2d, BatchNorm2d, ReLU, init
  from torch.ao.nn.intrinsic.qat import ConvBn2d, ConvBnReLU2d
  from torch.nn.modules.utils import _pair
  import torch.ao.nn.quantized
  import torch.ao.nn.quantized.dynamic
  import torch.ao.nn.qat
  import torch.ao.nn.intrinsic.qat
  import torch.ao.nn.qat.dynamic
  from torch.ao.quantization import prepare, convert, prepare_qat, quantize_qat, QuantStub, DeQuantStub, default_qconfig, default_qat_qconfig, default_embedding_qat_qconfig, default_symmetric_qnnpack_qat_qconfig, get_default_qat_qconfig, FixedQParamsFakeQuantize, FusedMovingAvgObsFakeQuantize, get_embedding_qat_module_mappings, get_embedding_static_quant_module_mappings, NoopObserver
  from torch.ao.quantization.qconfig import qconfig_equals
  from torch.testing._internal.common_quantization import DeFusedEmbeddingBagLinear, QuantizationTestCase, QuantStubModel, ManualLinearQATModel, ManualDropoutQATModel, ManualLinearDynamicQATModel, ManualConvLinearQATModel, ManualConvLinearSymmQATModel, ManualEmbeddingBagLinear, TwoLayerLinearModel, test_only_eval_fn, test_only_train_fn
  from torch.testing._internal.common_quantized import override_quantized_engine, supported_qengines, override_qengines
  from torch.testing._internal.common_utils import skipIfNoXNNPACK
  from hypothesis import given
  from hypothesis import strategies
  import torch.testing._internal.hypothesis_utils
  from functools import reduce
label_desc: Use image node_id 10 for calling the _ReferenceConvBnNd obj's underlying member method code with example usage: obj.from_float(cls, mod, qconfig) and returns: qat_convbn