Skip to content

Add new LengthsSplit operator (#10291)#10974

Closed
Oscarlight wants to merge 1 commit intopytorch:masterfrom
Oscarlight:export-D9013119
Closed

Add new LengthsSplit operator (#10291)#10974
Oscarlight wants to merge 1 commit intopytorch:masterfrom
Oscarlight:export-D9013119

Conversation

@Oscarlight
Copy link

Summary:
Pull Request resolved: #10291

This new operator will do the following:

Given a LENGTHS vector and n_splits, output a "split" LENGTHS vector where:

  1. Each length in input vector is split into n_splits values (thus output vector should have LENGTHS.size(0) * n_splits elements)
  2. The new lengths in output should be evenly split, and if the length is not divisible by n_splits, then order new values in descending order. (e.g. n_splits = 3, length = 5 -> 2 2 1)
  3. If n_splits > some element in the array, its split elements will contain 0s. (e.g. n_splits = 3, length = 2 - > 1 1 0)

Differential Revision: D9013119

@Oscarlight
Copy link
Author

@pytorchbot retest this please

1 similar comment
@Oscarlight
Copy link
Author

@pytorchbot retest this please

Copy link
Contributor

@bddppq bddppq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Oscarlight
Copy link
Author

@pytorchbot retest this please

3 similar comments
@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

Hi, @bddppq, a lot of runs are keep failing. Could you help to take a look? Thanks so much!

@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

@pytorchbot retest this please

3 similar comments
@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

@pytorchbot retest

@Oscarlight
Copy link
Author

@pytorchbot retest this please

2 similar comments
@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

@pytorchbot retest this please

1 similar comment
@Oscarlight
Copy link
Author

@pytorchbot retest this please

@Oscarlight
Copy link
Author

@pytorchbot retest this please

Summary:
Pull Request resolved: pytorch#10974

Pull Request resolved: pytorch#10291

This new operator will do the following:

Given a LENGTHS vector and n_splits, output a "split" LENGTHS vector where:

1. Each length in input vector is split into n_splits values (thus output vector should have LENGTHS.size(0) * n_splits elements)
2. The new lengths in output should be evenly split, and if the length is not divisible by n_splits, then order new values in descending order. (e.g. n_splits = 3, length = 5 -> 2 2 1)
3. If n_splits > some element in the array, its split elements will contain 0s. (e.g. n_splits = 3, length = 2 - > 1 1 0)

Reviewed By: bddppq, chocjy

Differential Revision: D9013119

fbshipit-source-id: ad773dcaae813c253068a7cf7e774020627f0b13
@Oscarlight
Copy link
Author

@pytorchbot retest this please

PenghuiCheng pushed a commit to PenghuiCheng/pytorch that referenced this pull request Sep 11, 2018
Summary:
Pull Request resolved: pytorch#10974

Pull Request resolved: pytorch#10291

This new operator will do the following:

Given a LENGTHS vector and n_splits, output a "split" LENGTHS vector where:

1. Each length in input vector is split into n_splits values (thus output vector should have LENGTHS.size(0) * n_splits elements)
2. The new lengths in output should be evenly split, and if the length is not divisible by n_splits, then order new values in descending order. (e.g. n_splits = 3, length = 5 -> 2 2 1)
3. If n_splits > some element in the array, its split elements will contain 0s. (e.g. n_splits = 3, length = 2 - > 1 1 0)

Reviewed By: bddppq, chocjy

Differential Revision: D9013119

fbshipit-source-id: 82bf3371ec08c41fc3379177f0007afc142e0d84
@ezyang ezyang added the merged label Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants