summaryrefslogtreecommitdiff
path: root/caffe2/ideep
diff options
context:
space:
mode:
authorJerry Zhang <jerryzh@fb.com>2018-10-09 10:47:24 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-10-09 10:53:52 -0700
commit1c69d368e1bc810c49939ac9fb4eb1f5e20bca3f (patch)
treeff1ba37b7ca985c59274faef79e979d3bb83d4a6 /caffe2/ideep
parentf564163951b15a14f777f01f0caf1b8ce64d3f00 (diff)
downloadpytorch-1c69d368e1bc810c49939ac9fb4eb1f5e20bca3f.tar.gz
pytorch-1c69d368e1bc810c49939ac9fb4eb1f5e20bca3f.tar.bz2
pytorch-1c69d368e1bc810c49939ac9fb4eb1f5e20bca3f.zip
Remove New with Allocator Registry (#12111)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12111 Setup allocator registry keyed by at::DeviceType, and remove New from StaticContext. Reviewed By: ezyang Differential Revision: D10022853 fbshipit-source-id: 3e88a181fe5df24f33f49b88be1f75284a185588
Diffstat (limited to 'caffe2/ideep')
-rw-r--r--caffe2/ideep/utils/ideep_context.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/caffe2/ideep/utils/ideep_context.h b/caffe2/ideep/utils/ideep_context.h
index b5c702ea3d..11bf97ee44 100644
--- a/caffe2/ideep/utils/ideep_context.h
+++ b/caffe2/ideep/utils/ideep_context.h
@@ -56,7 +56,7 @@ class IDEEPContext final : public BaseContext {
}
inline static at::DataPtr New(size_t nbytes) {
- return StaticContext()->New(nbytes);
+ return GetAllocator(CPU)->allocate(nbytes);
}
void CopyBytesSameDevice(size_t nbytes, const void* src, void* dst) override {
@@ -176,10 +176,6 @@ inline void IDEEPContext::CopyBytes<IDEEPContext, CPUContext>(
class IDEEPStaticContext : public BaseStaticContext {
public:
- inline at::DataPtr New(size_t nbytes) const override {
- return GetCPUAllocator()->allocate(nbytes);
- }
-
DeviceType GetDeviceType() override {
return IDEEP;
}