pytorch/test/cpp
Lucas Hosseini a84afb3a7c Use type-erased union for Buffer. (#54251)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/54251

Pull Request resolved: https://github.com/pytorch/tensorpipe/pull/324

In order to merge the channel hierarchies, we need a generic `Buffer` type, that can wrap either a `CpuBuffer` or a `CudaBuffer`.
The constraints are that, since this type is used by the channels, it cannot explicitly refer to `CudaBuffer`. We propose here a type-erasure based solution, with small-buffer optimization to avoid heap-allocating the wrapped concrete buffer.

This is a new version of D27001339 (c618dc13d2) which broke PyTorch OSS build.

Test Plan: CI

Reviewed By: lw, mrshenli

Differential Revision: D27156053

fbshipit-source-id: 4244302af33a3be91dcd06093c0d6045d081d3cc
2021-03-19 04:58:09 -07:00
..
api Add padding='same' mode to conv{1,2,3}d (#45667) 2021-03-18 16:22:03 -07:00
common
dist_autograd Forbid trailing whitespace (#53406) 2021-03-05 17:22:55 -08:00
jit [PyTorch Mobile] Dedup method names in bytecode serialization (#53677) 2021-03-16 15:24:47 -07:00
lite_interpreter_runtime [PyTorch][CI] Enable building test_lite_interpreter_runtime unittest in CI (macos) (#52566) 2021-03-08 13:09:25 -08:00
rpc Use type-erased union for Buffer. (#54251) 2021-03-19 04:58:09 -07:00
tensorexpr [NNC] Adding API to distribute loops (#53865) 2021-03-18 07:27:39 -07:00
__init__.py