Skip to content

Commit d94e1f5

Browse files
authored
Merge pull request #1754 from lcy-seso/fix_bug_of_AgentLayer
fix a bug of AgentLayer.
2 parents f7be384 + ec5bb80 commit d94e1f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

paddle/gserver/layers/AgentLayer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ void AgentLayer::forward(PassType passType) {
4242
// get Arguments from real layers
4343
if (numSamples_ > 0 && numSamples_ < realHeight) {
4444
if (realOutput.ids) {
45-
output_.ids->subVecFrom(*realOutput.ids, 0, numSamples_);
45+
output_.ids =
46+
IVector::create(realOutput.ids->getData(), numSamples_, useGpu_);
4647
} else {
4748
output_.subArgFrom(
4849
realOutput, /* offset */ 0, numSamples_, getSize(), useGpu_);

0 commit comments

Comments
 (0)