When to use C.layers.Signature?
I was tying to follow the tutorial 204 to build a seq2seq.
In this tutorial, there's a @C.layers.Signature for both create_model_greedy and create_criterion_function while create_model_train isn't. Why is it?When I try to add one to create_model_train like
@C.layers.Signature(input=InputSequence[C.layers.Tensor[input_vocab_dim]],
labels=LabelSequence[C.layers.Tensor[label_vocab_dim]])
it error out with
TypeError: argument labels's type SequenceOver[labelAxis][Tensor[69]] is incompatible with the type SequenceOver[labelAxis_times_1_minus_1][Tensor[69]] of thepassed Variable
What does labelAxis_times_1_minus_1 actually mean here acctually? Thanks for your help!
labelAxis_times_1_minus_1 comes from sequence.slice that removes BOS from the label. sequence.slice produces an output sequence with different length than input sequence, thus a new sequence axis is created with postfix of _times_1_minus_1 to note it's relationship with labelAxis. You need to use the signature with matching sequence axis.
Thanks! Closing...