Class Attention

Inheritance Relationships

Base Type

  • public mindspore::ops::BaseOperator

Class Documentation

class Attention : public mindspore::ops::BaseOperator

MultiHead-Attention op in MindIR.

Public Functions

inline Attention()

Constructor.

void Init(int64_t head_num, int64_t head_size, bool position_bias, bool cross = false)

Initialize Attention op.

参数
  • head_num[in] Define head number.

  • head_size[in] Define size per head.

  • cross[in] Define is cross attention. Default false.

  • position_bias[in] Define is position bias attention.