❓ [Question] How to set three input tensor shape in input_shape? #506
-
❓ QuestionI have three input tensor:src_tokens, dummy_embeded_x, dummy_encoder_embedding
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You set the input shapes as a list of lists or a list of dicts if you are using dynamic shape. So for your 3 inputs you would do something like this: "input_shapes": [[2,16], [1,10], [1, 15]] or something similar where the entries correspond to src_tokens, dummy_embeded_x, dummy_encoder_embedding in the order they will appear in the function signature for your forward i.e. in this case maybe something like To do dynamic shape it would look like this: "input_shapes": [
{
"min": [2, 16],
"opt": [2, 20],
"max: [2, 25],
}, {
"min": [1, 10],
"opt": [1, 20],
"max: [1, 25],
}, {
"min": [1, 20],
"opt": [1, 25],
"max: [1, 35],
}
] |
Beta Was this translation helpful? Give feedback.
You set the input shapes as a list of lists or a list of dicts if you are using dynamic shape.
So for your 3 inputs you would do something like this:
or something similar where the entries correspond to src_tokens, dummy_embeded_x, dummy_encoder_embedding in the order they will appear in the function signature for your forward i.e. in this case maybe something like
forward(src_tokens, dummy_embeded_x, dummy_encoder_embedding)
.To do dynamic shape it would look like this: