From 4c72b0634cc2c280f0edcc84a0ece00511fdd6cd Mon Sep 17 00:00:00 2001 From: wangmeng28 Date: Wed, 18 Oct 2017 15:36:36 +0800 Subject: [PATCH] Fix creation of tmp variable in factorization machine layer --- paddle/gserver/layers/FactorizationMachineLayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/gserver/layers/FactorizationMachineLayer.cpp b/paddle/gserver/layers/FactorizationMachineLayer.cpp index 8d9dcbaea7f..e5c9d1a90d5 100644 --- a/paddle/gserver/layers/FactorizationMachineLayer.cpp +++ b/paddle/gserver/layers/FactorizationMachineLayer.cpp @@ -33,10 +33,11 @@ bool FactorizationMachineLayer::init(const LayerMap& layerMap, /* initialize the latentVectors_ */ CHECK_EQ(inputLayers_.size(), 1UL); size_t height = inputLayers_[0]->getSize(); + CHECK_EQ(parameters_[0]->getSize(), height * factorSize_); latentVectors_ = std::unique_ptr(new Weight(height, factorSize_, parameters_[0])); - v2_ = latentVectors_->getW()->clone(0, 0, useGpu_); + v2_ = Matrix::create(height, factorSize_, false, useGpu_); return true; } -- GitLab