code: def maybe_cast(tensor):
      if (
          torch.is_autocast_enabled()
          and tensor.is_cuda
          and tensor.dtype != torch.double
      ):
          return tensor.float()
      else:
          return tensor
  
file_path: vision/torchvision/ops/roi_align.py
imports: from typing import List, Union
  import torch
  import torch._dynamo
  import torch.fx
  from torch import nn, Tensor
  from torch.jit.annotations import BroadcastingList2
  from torch.nn.modules.utils import _pair
  from torchvision.extension import _assert_has_ops, _has_ops
  from ..utils import _log_api_usage_once
  from ._utils import check_roi_boxes_shape, convert_boxes_to_roi_format
label_desc: Use image node_id 2 for calling a global function with example usage: maybe_cast(tensor) and returns: tensor, tensor