code: def __init__(self, dropout: float = None, scale: bool = True):
      super(ScaledDotProductAttention, self).__init__()
      if dropout is not None:
          self.dropout = nn.Dropout(p=dropout)
      else:
          self.dropout = dropout
      self.softmax = nn.Softmax(dim=2)
      self.scale = scale
  
imports: import math
  from typing import Dict, List, Tuple, Union
  import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 1 to create a new ScaledDotProductAttention object from inherited base classes: nn with example: obj = ScaledDotProductAttention(dropout, scale)