test_linspace : remove explicit for-loop#38191
Closed
kshitij12345 wants to merge 1 commit intopytorch:masterfrom
Closed
test_linspace : remove explicit for-loop#38191kshitij12345 wants to merge 1 commit intopytorch:masterfrom
kshitij12345 wants to merge 1 commit intopytorch:masterfrom
Conversation
Benchmark with same build settings on same system. gcc : version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) CPU : Intel® Core i5-8300H CPU @ 2.30GHz × 8 GPU : GTX 1050ti Test Cmd : `pytest test/test_torch.py -k linspace_cpu_float` Before : ``` test/test_torch.py .. [100%] ======================================================================== 2 passed, 5170 deselected in 24.43s ======================================================================== ``` After : ``` test/test_torch.py .. [100%] ======================================================================== 2 passed, 5170 deselected in 9.20s ========================================================================= ``` Test Cmd : `pytest test/test_torch.py -k linspace_cuda_float` Before : ``` test/test_torch.py ...... [100%] =================================================================== 6 passed, 5166 deselected in 83.84s (0:01:23) =================================================================== ``` After : ``` test/test_torch.py ...... [100%] ======================================================================== 6 passed, 5166 deselected in 40.18s ======================================================================== ```
Collaborator
Author
xuhdev
approved these changes
May 9, 2020
Collaborator
xuhdev
left a comment
There was a problem hiding this comment.
Perfect! This is a much neater solution than I had!
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
@mruberry has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Contributor
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
Summary: Reference : pytorch#38187 Benchmark with same build settings on same system. gcc : version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) CPU : Intel® Core i5-8300H CPU @ 2.30GHz × 8 GPU : GTX 1050ti Test Cmd : `pytest test/test_torch.py -k linspace_cpu_float` Before : ``` test/test_torch.py .. [100%] ======================================================================== 2 passed, 5170 deselected in 24.43s ======================================================================== ``` After : ``` test/test_torch.py .. [100%] ======================================================================== 2 passed, 5170 deselected in 9.20s ========================================================================= ``` Test Cmd : `pytest test/test_torch.py -k linspace_cuda_float` Before : ``` test/test_torch.py ...... [100%] =================================================================== 6 passed, 5166 deselected in 83.84s (0:01:23) =================================================================== ``` After : ``` test/test_torch.py ...... [100%] ======================================================================== 6 passed, 5166 deselected in 40.18s ======================================================================== ``` Pull Request resolved: pytorch#38191 Differential Revision: D21494478 Pulled By: mruberry fbshipit-source-id: fa58f727781425937a7b8212f9b63a739935eb86
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference : #38187
Benchmark with same build settings on same system.
gcc : version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)
CPU : Intel® Core i5-8300H CPU @ 2.30GHz × 8
GPU : GTX 1050ti
Test Cmd :
pytest test/test_torch.py -k linspace_cpu_floatBefore :
After :
Test Cmd :
pytest test/test_torch.py -k linspace_cuda_floatBefore :
After :