From 68164c1c3ed1b03b10f06a19537f312c203bd677 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Thu, 17 Jan 2019 15:53:52 -0800 Subject: [PATCH] Code style cleanup (#15854) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/15854 - Remove unnecessary `inline` keyword - Add a TODO stating the intention for Blob::ShareExternal() Reviewed By: dzhulgakov Differential Revision: D13605258 fbshipit-source-id: c0bc85c74c4ca4b3811d42ac7f866182e159d840 --- aten/src/ATen/core/blob.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aten/src/ATen/core/blob.h b/aten/src/ATen/core/blob.h index 88f87f437dd04..60694160c7f11 100644 --- a/aten/src/ATen/core/blob.h +++ b/aten/src/ATen/core/blob.h @@ -51,14 +51,14 @@ class CAFFE2_API Blob final : public c10::intrusive_ptr_target { /** * Returns the meta info of the blob. */ - inline const TypeMeta& meta() const noexcept { + const TypeMeta& meta() const noexcept { return meta_; } /** * Returns a printable typename of the blob. */ - inline const char* TypeName() const noexcept { + const char* TypeName() const noexcept { return meta_.name(); } @@ -155,6 +155,7 @@ class CAFFE2_API Blob final : public c10::intrusive_ptr_target { TypeMeta::Make::type>())); } + // TODO Remove ShareExternal() and have Blob always own its content void* ShareExternal(void* allocated, const TypeMeta& meta) { free_(); meta_ = meta; @@ -166,7 +167,7 @@ class CAFFE2_API Blob final : public c10::intrusive_ptr_target { /** * Resets the Blob to an empty one. */ - inline void Reset() { + void Reset() { free_(); pointer_ = nullptr; meta_ = TypeMeta();