当前位置:网站首页>torch. nn. Transformer import failed
torch. nn. Transformer import failed
2022-06-28 22:24:00 【Cyril_ KI】
Method 1
Import directly in the most primitive way :
from torch.nn.modules.transformer import Transformer, TransformerEncoder, TransformerDecoder, \
TransformerEncoderLayer, TransformerDecoderLayer
Method 2
stay torch.nn.modules Create a new folder _init_.pyi file , Then write this statement :
from .transformer import TransformerEncoder as TransformerEncoder, TransformerDecoder as TransformerDecoder, \
TransformerEncoderLayer as TransformerEncoderLayer, TransformerDecoderLayer as TransformerDecoderLayer, \
Transformer as Transformer
At this time, it can be used normally :
from torch.nn import Transformer, TransformerEncoder, TransformerDecoder, \
TransformerEncoderLayer, TransformerDecoderLayer
边栏推荐
- 華為雲的AI深潜之旅
- 【selenium自动化过程中的api抓包】browsermobproxy的安装和配置
- Qt5.15中qsrand,srand随机数生成函数已弃用问题
- C#/VB. Net to convert PDF to excel
- Detailed explanation of Zadig's self-test and joint debugging sub environment for developers
- Zadig + 洞态 IAST:让安全溶于持续交付
- Visual studio 2022 17.1 is now available!
- 昨天晚上失眠
- After crossing, she said that the multiverse really exists
- 10、标准I/O输入输出重定向及管道
猜你喜欢

6月底了,让我康康有多少准备跳槽的
![[golang] leetcode intermediate subset & Word Search](/img/3a/f63892160c25196335a633424c6d99.jpg)
[golang] leetcode intermediate subset & Word Search

穿越过后,她说多元宇宙真的存在

电商秒杀系统架构设计

Adding a markdown editor to lavel

Laravel文档阅读笔记-Adding a Markdown editor to Laravel

穿越过后,她说多元宇宙真的存在

Rosdep update using fishros to solve ros1/ros2 problems 2022

F1tenth gym of ROS 2 humble hawksbill

ROS 2 Humble Hawksbill 之 f1tenth gym
随机推荐
【selenium自动化过程中的api抓包】browsermobproxy的安装和配置
【HackTheBox】dancing(SMB)
常用工具类与commons 类库
Yiming Anke submitted a statement to the Hong Kong Stock Exchange: the loss doubled in 2021, and the past financing amount was exaggerated
In order to control the risks, how to choose a franchise company?
Description détaillée du schéma technique du sous - environnement syntonique auto - test de Zadig pour les développeurs
Hardware development notes (VII): basic process of hardware development, making a USB to RS232 module (VI): creating 0603 package and associating principle graphic devices
Use of axurer9 option group
职业问诊 | 在数据分析面试中,这样做自我介绍才靠谱
什么是低代码开发?
【HackTheBox】 meow
Heavyweight! CDA certification test preparation Q & A Online
Get to know Alibaba cloud (Cloud Computing) - development history, technical architecture, region and availability zone!
C#/VB. Net to convert PDF to excel
稳!上千微服务如何快速接入 Zadig(Helm Chart 篇)
共探数字技术与信息安全,第四届中俄数字论坛成功举办
MSCI 2022年市场分类评估
职业问诊 | 面试时被问到职业规划该怎么回答?
面试官:Redis中字符串的内部实现方式是什么?
关于杠杆的思考