Skip to content

❓ [Question] How to set three input tensor shape in input_shape? #506

Answered by narendasan
wxyhv asked this question in Q&A
Discussion options

You must be logged in to vote

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 forward(src_tokens, dummy_embeded_x, dummy_encoder_embedding).

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],
    "…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by narendasan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #493 on June 23, 2021 19:56.