docstr: Get the actual size (ignore all padded items) of each slate by summing item masks.
docstr_tok: ["Get","the","actual","size","(","ignore","all","padded","items",")","of","each","slate","by","summing","item","masks","."]
code: def _get_slate_size(self, state: rlt.FeatureData) -> torch.Tensor:
      """Get the actual size (ignore all padded items) of each slate by summing item masks."""
      mask = self._get_item_mask(state)
      return torch.minimum(
          mask.sum(1, keepdim=True),
          torch.tensor([self.slate_size], device=mask.device),
      )
  
imports: import enum
  import logging
  from typing import Optional
  import reagent.core.parameters
  import reagent.core.types
  import torch
  import torch.nn.functional
  from reagent.core.dataclasses import field
  from reagent.optimizer import Optimizer__Union, SoftUpdate
  from reagent.training.reagent_lightning_module import ReAgentLightningModule
  from reagent.training.rl_trainer_pytorch import RLTrainerMixin
label_desc: Use image node_id 8 for calling the SlateQTrainer obj's underlying member method code with example usage: obj._get_slate_size(state) and returns: torch