部分堆叠张量
我在形状的pytorch中有一些卷积层的输出,其中
b
是我的批次,c
是我的频道,h
是功能。我想将它们堆叠成一个完全连接的图层,而不会更改批处理,以便它们处于形状[B,C*H]
。我该怎么做?
I have some output from a convolutional layer in PyTorch of the shape [b,c,h]
where b
is my batches, c
is my channels, and h
is the features. I want to stack these to feed into a fully-connected layer without changing the batches, so that they are in the shape [b, c*h]
. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎简单的重塑或视图应该有效:
Seems like a simple reshape or view should work: