code: def subsequent_and_padding_mask(tgt_in_idx):
      """Create a mask to hide padding and future items"""
      # tgt_in_idx shape: batch_size, seq_len
  
      # tgt_tgt_mask shape: batch_size, 1, seq_len
      tgt_tgt_mask = (
          (tgt_in_idx != PADDING_SYMBOL).unsqueeze(-2).type(torch.int8)
      )
      # subseq_mask shape: 1, seq_len, seq_len
      subseq_mask = subsequent_mask(
          tgt_in_idx.size(-1), tgt_in_idx.device
      )
      # tgt_tgt_mask shape: batch_size, seq_len, seq_len
      tgt_tgt_mask = tgt_tgt_mask & subseq_mask
      return tgt_tgt_mask
  
imports: import copy
  import logging
  import math
  from enum import Enum
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 4 for calling a global function with example usage: subsequent_and_padding_mask(tgt_in_idx) and returns: tgt_tgt_mask