code: def test_frozen_batchnorm_fp16(self):
      from torch.cuda.amp import autocast
  
      C = 10
      input = torch.rand(1, C, 10, 10).cuda()
      m = FrozenBatchNorm2d(C).cuda()
      with autocast():
          output = m(input.half())
      self.assertEqual(output.dtype, torch.float16)
  
      # requires_grad triggers a different codepath
      input.requires_grad_()
      with autocast():
          output = m(input.half())
      self.assertEqual(output.dtype, torch.float16)
  
file_path: detectron2/tests/layers/test_blocks.py
imports: import unittest
  import torch
  from torch import nn
  from detectron2.layers import ASPP, DepthwiseSeparableConv2d, FrozenBatchNorm2d
  from detectron2.modeling.backbone.resnet import BasicStem, ResNet
label_desc: Use image node_id 3 for calling the TestBlocks obj's underlying member method code with example usage: obj.test_frozen_batchnorm_fp16() without return types