hunk.code_window:     with set_scriptable(True):
           model = create_model(model_name, pretrained=False)
       model.eval()
       input_size = _get_input_size(model, TARGET_JIT_SIZE)
       if max(input_size) > MAX_JIT_SIZE:  # NOTE using MAX_FWD_SIZE as the final limit is intentional
           pytest.skip("Fixed input size model > limit.")
       model = torch.jit.script(model)
       outputs = model(torch.randn((batch_size, *input_size)))
       assert outputs.shape[0] == batch_size
       assert not torch.isnan(outputs).any(), 'Output included NaNs'
  
hunk.labels: keep keep keep keep replace replace replace replace keep keep keep keep keep
hunk.file_path: tests/test_models.py
hunk.type: replace
file: from .bottleneck_attn import BottleneckAttn
  from .halo_attn import HaloAttn
  from .involution import Involution
  from .lambda_layer import LambdaLayer
  from .swin_attn import WindowAttention
  
  
  def get_self_attn(attn_type):
      if attn_type == 'bottleneck':
          return BottleneckAttn
      elif attn_type == 'halo':
          return HaloAttn
      elif attn_type == 'lambda':
          return LambdaLayer
      elif attn_type == 'swin':
          return WindowAttention
      elif attn_type == 'involution':
          return Involution
      else:
          assert False, f"Unknown attn type ({attn_type})"
  
  
  def create_self_attn(attn_type, dim, stride=1, **kwargs):
      attn_fn = get_self_attn(attn_type)
      return attn_fn(dim, stride=stride, **kwargs)
  