Code style cleanup (#15854)
authorSebastian Messmer <messmer@fb.com>
Thu, 17 Jan 2019 23:53:52 +0000 (15:53 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 18 Jan 2019 00:03:56 +0000 (16:03 -0800)
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

index 88f87f4..6069416 100644 (file)
@@ -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<typename std::remove_const<T>::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();