mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
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
This commit is contained in:
parent
20d1bff292
commit
b5db6ac9f1
|
|
@ -36,11 +36,11 @@ class UpsampleNearestOp final : public Operator<Context> {
|
|||
|
||||
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<T>());
|
||||
|
||||
int d1;
|
||||
int d2;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user