最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - Pytorch Histogram- but only one dimension in 3D tensor - Stack Overflow

programmeradmin2浏览0评论

I'm currently using broadcasting, given a 3D pytorch tensor of shape 32 x 15000 by (128*batch_size) (huge, I know. Cannot shrink this) to generate a histogram for each 32x15000 array. I am storing lowers and uppers for each to easily bin using broadcasting.

Is there a torch.histogram alternative that will let me do this instead? broadcasting consumes huge amounts of memory as the mask ends up being 32 x 15000 x (128batch_sizebins) and I cannot fit this in VRAM.

Any suggestions would be welcome. I'm currently getting around the issue by iteratively handling each bin, but that leads to massive speed losses.

发布评论

评论列表(0)

  1. 暂无评论