(beta)torch_npu.contrib.BiLSTM
接口原型
torch_npu.contrib.BiLSTM(input_size, hidden_size)
功能描述
将NPU兼容的双向LSTM操作应用于输入序列。
参数说明
- input_size:The number of expected features in the input `x`
- hidden_size:The number of features in the hidden state `h`
支持的型号
- Atlas 训练系列产品
- Atlas A2 训练系列产品
- Atlas 推理系列产品
调用示例
>>> r = torch_npu.contrib.BiLSTM(512, 256).npu() >>> input_tensor = torch.randn(26, 2560, 512).npu() >>> output = r(input_tensor)
父主题: torch_npu.contrib