Ask Your Question
3

The error "ValueError" occurred which implies that you need to activate padding by setting "padding=True" in order to create tensors that have the same length.

asked 2023-06-25 12:33:30 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-06-25 12:58:01 +0000

lalupa gravatar image

This error typically occurs when working with sequences or tensors that have variable lengths. In order to perform certain operations on these sequences, such as concatenation, it is necessary to make them the same length. This can be achieved through padding, which involves adding zeroes or another specified value to the shorter sequences in order to make them the same length as the longest sequence.

To resolve the error, you can set the "padding=True" parameter when creating your tensor or sequence. This will ensure that any shorter sequences are padded with zeroes to match the length of the longest sequence. Alternatively, you may need to adjust the parameters of your operation to account for the variable lengths of the inputs.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-25 12:33:30 +0000

Seen: 10 times

Last updated: Jun 25 '23