class_docstr: **Transformer** 当中的 **DotAttention**
  
  :param key_size:
  :param value_size:
  :param dropout:
class_docstr_tok: ["*","*","Transformer","*","*","\u5f53\u4e2d\u7684","*","*","DotAttention","*","*",":","param","key_size",":",":","param","value_size",":",":","param","dropout",":"]
docstr: :param Q: ``[..., seq_len_q, key_size]``
  :param K: ``[..., seq_len_k, key_size]``
  :param V: ``[..., seq_len_k, value_size]``
  :param mask_out: ``[..., 1, seq_len]`` or ``[..., seq_len_q, seq_len_k]``
docstr_tok: [":","param","Q",":","``","[","...",",","seq_len_q",",","key_size","]","``",":","param","K",":","``","[","...",",","seq_len_k",",","key_size","]","``",":","param","V",":","``","[","...",",","seq_len_k",",","value_size","]","``",":","param","mask_out",":","``","[","...",",","1",",","seq_len","]","``","or","``","[","...",",","seq_len_q",",","seq_len_k","]","``"]
code: def forward(self, Q, K, V, mask_out=None):
      r"""
  
      :param Q: ``[..., seq_len_q, key_size]``
      :param K: ``[..., seq_len_k, key_size]``
      :param V: ``[..., seq_len_k, value_size]``
      :param mask_out: ``[..., 1, seq_len]`` or ``[..., seq_len_q, seq_len_k]``
      """
      output = torch.matmul(Q, K.transpose(-1, -2)) / self.scale
      if mask_out is not None:
          output.masked_fill_(mask_out, -1e9)
      output = self.softmax(output)
      output = self.drop(output)
      return torch.matmul(output, V)
  
imports: import math
  import torch
  import torch.nn.functional
  from torch import nn
  from .decoder.seq2seq_state import TransformerState
label_desc: Use image node_id 2 for calling the DotAttention obj's underlying member method code with example usage: obj.forward(Q, K, V, mask_out) and returns: torch