class_docstr: A linear module attached with FakeQuantize modules for weight,
  used for quantization aware training.
  
  We adopt the same interface as `torch.nn.Linear`, please see
  https://pytorch.org/docs/stable/nn.html#torch.nn.Linear
  for documentation.
  
  Similar to `torch.nn.Linear`, with FakeQuantize modules initialized to
  default.
  
  Attributes:
      weight: fake quant module for weight
class_docstr_tok: ["A","linear","module","attached","with","FakeQuantize","modules","for","weight",",","used","for","quantization","aware","training",".","We","adopt","the","same","interface","as","`","torch.nn.Linear","`",",","please","see","https",":","\/\/pytorch.org\/docs\/stable\/nn.html","#","torch.nn.Linear","for","documentation",".","Similar","to","`","torch.nn.Linear","`",",","with","FakeQuantize","modules","initialized","to","default",".","Attributes",":","weight",":","fake","quant","module","for","weight"]
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):
      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_before_parametrizations(mod) == cls._FLOAT_MODULE, (
          " qat."
          + cls.__name__
          + ".from_float only works for "
          + cls._FLOAT_MODULE.__name__
      )
      assert hasattr(
          mod, "qconfig"
      ), "Input float module must have qconfig defined"
      assert mod.qconfig, "Input float module must have a valid qconfig"
      if type_before_parametrizations(mod) == LinearReLU:
          mod = mod[0]
  
      qconfig = mod.qconfig
      qat_linear = cls(
          mod.in_features,
          mod.out_features,
          bias=mod.bias is not None,
          qconfig=qconfig,
      )
  
      if is_parametrized(mod, "weight"):
          transfer_parametrizations_and_params(
              mod, qat_linear, "weight"
          )
      else:
          qat_linear.weight = mod.weight
  
      if is_parametrized(mod, "bias"):
          transfer_parametrizations_and_params(mod, qat_linear, "bias")
      else:
          qat_linear.bias = mod.bias
  
      return qat_linear
  
file_path: pytorch/torch/ao/nn/qat/modules/linear.py
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.ao.nn.intrinsic import LinearReLU
  from torch.nn.utils.parametrize import is_parametrized, type_before_parametrizations, transfer_parametrizations_and_params
label_desc: Use image node_id 3 for calling the Linear obj's underlying member method code with example usage: obj.from_float(cls, mod) and returns: qat_linear