]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - jacinto-ai/caffe-jacinto.git/blobdiff - src/caffe/blob.hpp
updated a bunch of things, ready to test if it breaks things
[jacinto-ai/caffe-jacinto.git] / src / caffe / blob.hpp
index a14c046130799b80e554bd63555d49d26291bd10..f31d3b0f693c7b3f3a60412e390b7f0be3064b32 100644 (file)
@@ -17,8 +17,6 @@ class Blob {
        diff_() {}
   explicit Blob(const int num, const int channels, const int height,
     const int width);
-  Blob(const Blob<Dtype>& source);
-  const Blob<Dtype>& operator=(const Blob<Dtype>& src);
   virtual ~Blob() {}
   void Reshape(const int num, const int height,
       const int width, const int channels);
@@ -31,6 +29,10 @@ class Blob {
       const int w = 0) const {
     return ((n * channels_ + c) * height_ + h) * width_ + w;
   }
+  // Copy from source. If copy_diff is false, we copy the data; if copy_diff
+  // is true, we copy the diff.
+  void CopyFrom(const Blob<Dtype>& source, bool copy_diff = false,
+      bool reshape = false);
 
   inline Dtype data_at(const int n, const int c, const int h,
       const int w) const {
@@ -52,9 +54,9 @@ class Blob {
   Dtype* mutable_gpu_diff();
   void Update();
   void FromProto(const BlobProto& proto);
-  void ToProto(BlobProto* proto, bool write_diff = false);
+  void ToProto(BlobProto* proto, bool write_diff = false) const;
 
- private:
+ protected:
   shared_ptr<SyncedMemory> data_;
   shared_ptr<SyncedMemory> diff_;
   int num_;
@@ -62,6 +64,8 @@ class Blob {
   int height_;
   int width_;
   int count_;
+
+  DISABLE_COPY_AND_ASSIGN(Blob);
 };  // class Blob
 
 }  // namespace caffe