hunk.code_window: MAX_FFEAT_SIZE = 256
   def _get_input_size(model, target=None):
       default_cfg = model.default_cfg
       input_size = default_cfg['input_size']
       if 'fixed_input_size' in default_cfg and default_cfg['fixed_input_size']:
           return input_size
  
hunk.labels: keep keep keep replace replace replace replace keep
hunk.after_edit: def _get_input_size(model=None, model_name='', target=None):
       if model is None:
           assert model_name, "One of model or model_name must be provided"
           input_size = get_model_default_value(model_name, 'input_size')
           fixed_input_size = get_model_default_value(model_name, 'fixed_input_size')
           min_input_size = get_model_default_value(model_name, 'min_input_size')
       else:
           default_cfg = model.default_cfg
           input_size = default_cfg['input_size']
           fixed_input_size = default_cfg.get('fixed_input_size', None)
           min_input_size = default_cfg.get('min_input_size', None)
       assert input_size is not None
       if fixed_input_size:
  
hunk.file_path: tests/test_models.py
hunk.type: replace
file: """ Linear layer (alternate definition)
  """
  import torch
  import torch.nn.functional as F
  from torch import nn as nn
  
  
  class Linear(nn.Linear):
      r"""Applies a linear transformation to the incoming data: :math:`y = xA^T + b`
  
      Wraps torch.nn.Linear to support AMP + torchscript usage by manually casting
      weight & bias to input.dtype to work around an issue w/ torch.addmm in this use case.
      """
      def forward(self, input: torch.Tensor) -> torch.Tensor:
          if torch.jit.is_scripting():
              bias = self.bias.to(dtype=input.dtype) if self.bias is not None else None
              return F.linear(input, self.weight.to(dtype=input.dtype), bias=bias)
          else:
              return F.linear(input, self.weight, self.bias)
  