当前位置:网站首页>torch. nn. utils. rnn. pad_ Detailed explanation of sequence() [pytoch getting started manual]
torch. nn. utils. rnn. pad_ Detailed explanation of sequence() [pytoch getting started manual]
2022-06-10 15:53:00 【Classmate K】
The function prototype
torch.nn.utils.rnn.pad_sequence(sequences, batch_first=False, padding_value=0.0)
The functionality
This function returns a size of T x B x * or B x T x * Tensor , among T Is the length of the longest sequence .
Parameters,
sequences (list[Tensor]): A list of variable length sequences ,shape=[batch_size, N],N Different lengths .batch_first (bool, optional): Default batch_size In the first dimensionpadding_value (float, optional): Fill the value of the , The default is 0.
Example
from torch.nn.utils.rnn import pad_sequence
a = torch.ones(25, 300)
b = torch.ones(22, 300)
c = torch.ones(15, 300)
pad_sequence([a, b, c]).size()
Output
torch.Size([25, 3, 300])
边栏推荐
- 推荐一个好用的设计师导航网址
- How to improve document management
- Anba cv2fs/cv22fs obtained ASIL C chip function safety certification, surpassing the level of similar chips in the market
- Solution to some problems of shadow knife RPA learning and meeting Excel
- 我用 MATLAB 复刻了抖音爆火小游戏 苹果蛇
- 音视频处理三剑客之 AEC:回声产生原因及回声消除原理
- 广和通携手中国移动、惠普、联发科、英特尔合作打造5G全互联PC泛终端系列产品
- Anti "internal roll", it is said that 360 enterprise security cloud will launch the "one click forced off duty" function, and the computer will automatically close the office software
- 姿态估计之2D人体姿态估计 - Distribution Aware Coordinate Representation for Human Pose Estimation【转-修改】
- Self recommendation - in depth understanding of the rust Standard Library Kernel
猜你喜欢

AEC of the three swordsmen in audio and video processing: the cause of echo generation and the principle of echo cancellation

opencv神经网络库之SVM和ANN_MLP的使用

姿态估计之2D人体姿态估计 - Numerical Coordinate Regression with Convolutional Neural Networks(DSNT)

“绽放杯”5G应用奖项大满贯!广和通多个联合项目荣获通用产品专题赛一、二、三等奖

Software intelligence: formal rules of AAAS system metrics and grammars

Méthodes couramment utilisées dans uniapp - TIMESTAMP et Rich Text Analysis picture

Vins Theory and Code detail 4 - Initialization

SQL language

直播预告 | 解构OLAP!新型多维分析架构范式全公开!Apache Doris 将带来五个重磅议题!

What has guanghetong done in the three years of 5g business from "seeding in the first generation" to "flower on the ground"?
随机推荐
RK3308--8声道改成双声道+录音增益
opencv神经网络库之SVM和ANN_MLP的使用
姿态估计之2D人体姿态估计 - Associative Embedding: End-to-End Learning for Joint Detection and Grouping
[MySQL basics]
顺应医改,积极布局——集采背景下的高值医用耗材发展洞察2022
What has guanghetong done in the three years of 5g business from "seeding in the first generation" to "flower on the ground"?
2D human posture estimation for posture estimation - associated embedding: end to end learning for joint detection and grouping
How does CRM help enterprises and salespeople?
MapReduce之Map阶段的join操作案例
Apple style Chinese: it seems to express the meaning clearly, and the Apple style propaganda copy that you don't fully understand
广和通高算力智能模组为万亿级市场5G C-V2X注智
【MySQL基础】
云图说|每个成功的业务系统都离不开APIG的保驾护航
[high code file format API] Shanghai daoning provides you with the file format API set Aspose, which can create, convert and operate more than 100 file formats in just a few lines of code
【无标题】
[untitled]
2290. Minimum Obstacle Removal to Reach Corner
TensorFlow实战Google深度学习框架第二版学习总结-TensorFlow安装
MapReduce之分区案例的代码实现
Comply with medical reform and actively layout -- insight into the development of high-value medical consumables under the background of centralized purchase 2022