diff --git a/paddle/framework/tensor.h b/paddle/framework/tensor.h index 2edc981cdd06f4dca01ce81285608f19b1e6e318..039ab08374e999716f9f3d8cfaa112bd9a0c73d1 100644 --- a/paddle/framework/tensor.h +++ b/paddle/framework/tensor.h @@ -132,10 +132,10 @@ class Tensor { template struct PlaceholderImpl : public Placeholder { PlaceholderImpl(Place place, size_t size) - : place_(place), - size_(size), - ptr_(static_cast(memory::Alloc(place, size)), - memory::PODDeleter(place)) { + : ptr_(static_cast(memory::Alloc(place, size)), + memory::PODDeleter(place)), + place_(place), + size_(size) { PADDLE_ENFORCE(ptr_ != nullptr, "Insufficient %s memory to allocation.", is_cpu_place(place_) ? "CPU" : "GPU"); }