Please sign in to comment.
Optimize zero length input (#31602)
Summary: Pull Request resolved: pytorch/pytorch#31602 Pull Request resolved: #3943 Zero length input is something we hit fairly frequently in practice. Previous handling of global TensorPool involves two locks per input (acquire and reclaim). Here we use a specialized anchor tensor to host zero length input. Note that it is only padded to max sequence length. If necessary, an easy extension can be added to pad to max `InputPlaceholder.getType().size()`. Reviewed By: jfix71 Differential Revision: D19192467 fbshipit-source-id: cafdc1eb7bf9b9d6ead04a0243b0be838f6b71cd
- Loading branch information
Showing with 37 additions and 11 deletions.