pytorch
cb43170d - Add memory format support to the `resize_` op. (#28292)

Commit
5 years ago
Add memory format support to the `resize_` op. (#28292) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/28292 Allows to simplify patterns like: 1. output.resize_({sizeB, sizeC, osizeH, osizeW}).as_strided_({sizeB, sizeC, osizeH, osizeW}, {sizeC*osizeH*osizeW, 1, osizeW*sizeC, sizeC}); 2. output.resize_({nbatch, nInputPlane, outputHeight, outputWidth}); indices.resize_({nbatch, nInputPlane, outputHeight, outputWidth}); output.unsafeGetTensorImpl()->empty_tensor_restride(memory_format); indices.unsafeGetTensorImpl()->empty_tensor_restride(memory_format); 3. gradInput.resize_as_(input); gradInput.unsafeGetTensorImpl()->empty_tensor_restride(memory_format); Test Plan: Imported from OSS Differential Revision: D18044978 Pulled By: VitalyFedyunin fbshipit-source-id: bbf67c25f9cf88bc6e949089a3b247df50f86dc4
Parents
  • aten/src/ATen/native
    • File
      Resize.cpp
    • File
      ResizeCommon.h
    • cuda
      • File
        Resize.cu
    • File
      native_functions.yaml
    • quantized/cpu
      • File
        tensor_operators.cpp
  • test
    • File
      test_torch.py
  • tools/autograd/templates
    • File
      VariableType.h
  • torch/csrc/autograd
    • File
      VariableTypeManual.cpp