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