From: Jerry Zhang Date: Thu, 6 Dec 2018 19:16:07 +0000 (-0800) Subject: Tensor construction codemod - 3/3 (#14835) X-Git-Tag: accepted/tizen/6.5/unified/20211028.231830~2416 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b5db6ac9f1a3c8ee5584b671bfad080b2c12c912;p=platform%2Fupstream%2Fpytorch.git Tensor construction codemod - 3/3 (#14835) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/14835 Codemod generated with clangr shard mode, 25 files per diff, motivation: https://github.com/pytorch/pytorch/pull/12407 Reviewed By: bddppq Differential Revision: D13335184 fbshipit-source-id: 26d8247e16b30bdff045530034af9b72c76d066f --- diff --git a/modules/detectron/upsample_nearest_op.h b/modules/detectron/upsample_nearest_op.h index 57e5440..c220745 100644 --- a/modules/detectron/upsample_nearest_op.h +++ b/modules/detectron/upsample_nearest_op.h @@ -36,11 +36,11 @@ class UpsampleNearestOp final : public Operator { bool RunOnDevice() override { auto& X = Input(0); - auto* Y = Output(0); + auto out_shape = X.sizes().vec(); out_shape[X.dim() - 1] *= scale_; out_shape[X.dim() - 2] *= scale_; - Y->Resize(out_shape); + auto* Y = Output(0, out_shape, at::dtype()); int d1; int d2;