aten/src/ATen/native/Indexing.cpp
// Unsqueezes src `before` times at the front and `after` times at the end
Unsqueezes src `before` times at the front and `after` times at the end
Unsqueezes src ` before ` times at the front and ` after ` times at the end
static Tensor unsqueezeN(const Tensor & src, int64_t before, int64_t after) {
  auto srcSizes = src.sizes();
  auto nDim = src.dim();
  std::vector<int64_t> sizes(nDim + before + after, 1);
  for (int64_t i = 0; i < nDim; i++) {
    sizes[i + before] = srcSizes[i];
  }
  return src.view(sizes);
}
static Tensor unsqueezeN ( const Tensor & src , int64_t before , int64_t after ) { auto srcSizes = src . sizes ( ) ; auto nDim = src . dim ( ) ; std :: vector < int64_t > sizes ( nDim + before + after , 1 ) ; for ( int64_t i = 0 ; i < nDim ; i ++ ) { sizes [ i + before ] = srcSizes [ i ] ; } return src . view ( sizes ) ; }
Unsqueezes src `before` times at the front and `after` times at the end
Unsqueezes src ` before ` times at the front and ` after ` times at the end