Skip to content

Commit f6f9fd7

Browse files
committed
remove unnecessary param in degradeSequence
1 parent a7730d4 commit f6f9fd7

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

paddle/gserver/layers/SequencePoolLayer.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,16 @@ void SequencePoolLayer::forward(PassType passType) {
5656
CHECK_EQ(newBatchSize_, starts->getSize() - 1);
5757

5858
resetOutput(newBatchSize_, dim);
59-
if (type_) {
60-
CHECK(input.subSequenceStartPositions)
61-
<< "when trans_type = seq, input must hasSubseq";
62-
}
59+
6360
/* If type_ = kNonSeq, both seq has or not has sub-seq degrade to a non-seq,
6461
* thus, in this case, output_ has no sequenceStartPositions.
6562
* If type_ = kSeq, seq has sub-seq degrades to a seq, thus, only in this
6663
* case, we should compute the new sequenceStartPositions.
6764
*/
6865
if (type_) {
69-
output_.degradeSequence(input, useGpu_);
66+
CHECK(input.subSequenceStartPositions)
67+
<< "when trans_type = seq, input must hasSubseq";
68+
output_.degradeSequence(input);
7069
}
7170
}
7271

paddle/parameter/Argument.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ void Argument::checkSubset() const {
583583
}
584584
}
585585

586-
void Argument::degradeSequence(const Argument& input, bool useGpu) {
586+
void Argument::degradeSequence(const Argument& input) {
587587
CHECK_EQ(input.hasSubseq(), 1UL);
588588
size_t numSequences = input.getNumSequences();
589589
size_t numSubSequences = input.getNumSubSequences();

paddle/parameter/Argument.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ struct Argument {
296296
/*
297297
sequence has sub-sequence degrades to a sequence.
298298
*/
299-
void degradeSequence(const Argument& input, bool useGpu);
299+
void degradeSequence(const Argument& input);
300300

301301
/**
302302
* @brief getValueString will return the argument's output in string. There

0 commit comments

Comments
 (0)