首页 > TAG信息列表 > 打平
  • PytorchTensor的索引与切片例子
    PytorchTensor的索引与切⽚例⼦1. Pytorch风格的索引根据Tensor的shape,从前往后索引,依次在每个维度上做索引。⽰例代码:import torcha = torch.rand(4, 3, 28, 28)print(a[0].shape) #取到第⼀个维度print(a[0, 0].shape) # 取到⼆个维度print(a[1, 2, 2, 4]) # 具体到某个元素
    时间:2023-07-01  热度:10℃
Copyright ©2019-2024 Comsenz Inc.Powered by © 易纺专利技术学习网 豫ICP备2022007602号 豫公网安备41160202000603 站长QQ:729038198 关于我们 投诉建议