提交 f6f9fd7a 编写于 作者: L Luo Tao

remove unnecessary param in degradeSequence

上级 a7730d40
...@@ -56,17 +56,16 @@ void SequencePoolLayer::forward(PassType passType) { ...@@ -56,17 +56,16 @@ void SequencePoolLayer::forward(PassType passType) {
CHECK_EQ(newBatchSize_, starts->getSize() - 1); CHECK_EQ(newBatchSize_, starts->getSize() - 1);
resetOutput(newBatchSize_, dim); resetOutput(newBatchSize_, dim);
if (type_) {
CHECK(input.subSequenceStartPositions)
<< "when trans_type = seq, input must hasSubseq";
}
/* If type_ = kNonSeq, both seq has or not has sub-seq degrade to a non-seq, /* If type_ = kNonSeq, both seq has or not has sub-seq degrade to a non-seq,
* thus, in this case, output_ has no sequenceStartPositions. * thus, in this case, output_ has no sequenceStartPositions.
* If type_ = kSeq, seq has sub-seq degrades to a seq, thus, only in this * If type_ = kSeq, seq has sub-seq degrades to a seq, thus, only in this
* case, we should compute the new sequenceStartPositions. * case, we should compute the new sequenceStartPositions.
*/ */
if (type_) { if (type_) {
output_.degradeSequence(input, useGpu_); CHECK(input.subSequenceStartPositions)
<< "when trans_type = seq, input must hasSubseq";
output_.degradeSequence(input);
} }
} }
......
...@@ -583,7 +583,7 @@ void Argument::checkSubset() const { ...@@ -583,7 +583,7 @@ void Argument::checkSubset() const {
} }
} }
void Argument::degradeSequence(const Argument& input, bool useGpu) { void Argument::degradeSequence(const Argument& input) {
CHECK_EQ(input.hasSubseq(), 1UL); CHECK_EQ(input.hasSubseq(), 1UL);
size_t numSequences = input.getNumSequences(); size_t numSequences = input.getNumSequences();
size_t numSubSequences = input.getNumSubSequences(); size_t numSubSequences = input.getNumSubSequences();
......
...@@ -296,7 +296,7 @@ struct Argument { ...@@ -296,7 +296,7 @@ struct Argument {
/* /*
sequence has sub-sequence degrades to a sequence. sequence has sub-sequence degrades to a sequence.
*/ */
void degradeSequence(const Argument& input, bool useGpu); void degradeSequence(const Argument& input);
/** /**
* @brief getValueString will return the argument's output in string. There * @brief getValueString will return the argument's output in string. There
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册