class_docstr: Main class for Generalized R-CNN.
  
  Args:
      backbone (nn.Module):
      rpn (nn.Module):
      roi_heads (nn.Module): takes the features + the proposals from the RPN and computes
          detections / masks from it.
      transform (nn.Module): performs the data transformation from the inputs to feed into
          the model
code: def eager_outputs(self, losses, detections):
      # type: (Dict[str, Tensor], List[Dict[str, Tensor]]) -> Union[Dict[str, Tensor], List[Dict[str, Tensor]]]
      if self.training:
          return losses
  
      return detections
  
file_path: vision/torchvision/models/detection/generalized_rcnn.py
imports: import warnings
  from collections import OrderedDict
  from typing import Dict, List, Optional, Tuple, Union
  import torch
  from torch import nn, Tensor
  from ...utils import _log_api_usage_once
label_desc: Use image node_id 2 for calling the GeneralizedRCNN obj's underlying member method code with example usage: obj.eager_outputs(losses, detections) and returns: detections, losses