Help make test dependent on randint compatible with python 3.12
It seems that python 3.12 is a little stricter on the inputs of randint.
I hope this helps
In [1]: import random
In [2]: random.randint(10, 10/2)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[2], line 1
----> 1 random.randint(10, 10/2)
File ~/miniforge3/envs/py12/lib/python3.12/random.py:336, in Random.randint(self, a, b)
332 def randint(self, a, b):
333 """Return random integer in range [a, b], including both end points.
334 """
--> 336 return self.randrange(a, b+1)
File ~/miniforge3/envs/py12/lib/python3.12/random.py:312, in Random.randrange(self, start, stop, step)
309 raise ValueError("empty range for randrange()")
311 # Stop argument supplied.
--> 312 istop = _index(stop)
313 width = istop - istart
314 istep = _index(step)
TypeError: 'float' object cannot be interpreted as an integer
:link: Helpful Links
:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8119
- :page_facing_up: Preview Python docs built from this PR
Note: Links to docs will display an error until the docs builds have been completed.
:x: 14 New Failures, 18 Unrelated Failures
As of commit a4bc6b3022d57f33683aae364536e26d6c1e4cd2 with merge base dd66a9d83d499788a7589cc4bf0d5fb6bc3a2127 ():
NEW FAILURES - The following jobs have failed:
-
CMake / macos (macos-12) / macos-job (gh)
The process '/usr/local/bin/git' failed with exit code 128 -
CMake / macos (macos-m1-stable) / macos-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
CMake / windows (windows.4xlarge, cpu) / windows-job (gh)
The process 'C:\Program Files\Git\cmd\git.exe' failed with exit code 128 -
CMake / windows (windows.g5.4xlarge.nvidia.gpu, cuda, 11.8) / windows-job (gh)
The process 'C:\Program Files\Git\cmd\git.exe' failed with exit code 128 -
Tests / unittests-macos (3.10, macos-12) / macos-job (gh)
The process '/usr/local/bin/git' failed with exit code 128 -
Tests / unittests-macos (3.11, macos-12) / macos-job (gh)
The process '/usr/local/bin/git' failed with exit code 128 -
Tests / unittests-macos (3.8, macos-12) / macos-job (gh)
The process '/usr/local/bin/git' failed with exit code 128 -
Tests / unittests-macos (3.8, macos-m1-stable) / macos-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Tests / unittests-macos (3.9, macos-12) / macos-job (gh)
The process '/usr/local/bin/git' failed with exit code 128 -
Tests / unittests-windows (3.10, windows.4xlarge, cpu) / windows-job (gh)
The process 'C:\Program Files\Git\cmd\git.exe' failed with exit code 128 -
Tests / unittests-windows (3.11, windows.4xlarge, cpu) / windows-job (gh)
The process 'C:\Program Files\Git\cmd\git.exe' failed with exit code 128 -
Tests / unittests-windows (3.8, windows.4xlarge, cpu) / windows-job (gh)
The process 'C:\Program Files\Git\cmd\git.exe' failed with exit code 128 -
Tests / unittests-windows (3.8, windows.g5.4xlarge.nvidia.gpu, cuda, 11.8) / windows-job (gh)
The process 'C:\Program Files\Git\cmd\git.exe' failed with exit code 128 -
Tests / unittests-windows (3.9, windows.4xlarge, cpu) / windows-job (gh)
The process 'C:\Program Files\Git\cmd\git.exe' failed with exit code 128
FLAKY - The following jobs failed but were likely due to flakiness present on trunk:
-
CMake / linux (linux.12xlarge, cpu) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
CMake / linux (linux.g5.4xlarge.nvidia.gpu, cuda, 11.8) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Docs / build / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Lint / c-source / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Lint / python-source-and-configs / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Lint / python-types / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Prototype tests on Linux / unittests-prototype (3.10, linux.12xlarge, cpu) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Prototype tests on Linux / unittests-prototype (3.11, linux.12xlarge, cpu) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Prototype tests on Linux / unittests-prototype (3.8, linux.12xlarge, cpu) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Prototype tests on Linux / unittests-prototype (3.8, linux.g5.4xlarge.nvidia.gpu, cuda, 11.8) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Prototype tests on Linux / unittests-prototype (3.9, linux.12xlarge, cpu) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Tests / onnx / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Tests / unittests-extended / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Tests / unittests-linux (3.10, linux.12xlarge, cpu) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Tests / unittests-linux (3.11, linux.12xlarge, cpu) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Tests / unittests-linux (3.8, linux.12xlarge, cpu) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Tests / unittests-linux (3.8, linux.g5.4xlarge.nvidia.gpu, cuda, 11.8) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128 -
Tests / unittests-linux (3.9, linux.12xlarge, cpu) / linux-job (gh)
The process '/usr/bin/git' failed with exit code 128
This comment was automatically generated by Dr. CI and updates every 15 minutes.
Thanks for the PR @hmaarrfk .
We don't support 3.12 yet but when the time comes, we'll be happy to re-consider this PR.
I genuinely hope that this is not here to stay TBH
>>> random.randint(0, 4/2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/nicolashug/.miniconda3/envs/fuck/lib/python3.12/random.py", line 336, in randint
return self.randrange(a, b+1)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/nicolashug/.miniconda3/envs/fuck/lib/python3.12/random.py", line 312, in randrange
istop = _index(stop)
^^^^^^^^^^^^
TypeError: 'float' object cannot be interpreted as an integer
thanks for looking at this so quickly and taking the time to test on your machine.
this seems intentional. see notes about automatic conversation.
https://docs.python.org/3/library/random.html#functions-for-integers
integer division resolves this issue easily. the PR is 8 characters that go in the right direction toward 3.12 support without hurting other versions in any way. it is contained in the test suite, and it is obvious from inspection that the type of the inputs to the division operator are integers.
I mostly just wanted to help given that I had tried to see how far along python 3.12 one could go. I'm not asking you to accelerate your timeline in any way.
take it or leave it I guess.
Just a kind ping hoping you can consider the introduction of a total of 10 characters.
Thank you for the ping @hmaarrfk . We'll merge the PR in due time, when 3.12 support becomes official for Pytorch and torchvision.
I'm sure you're experienced enough to know that the complexity, debt and criteria for inclusion of a PR doesn't correlate with its number of characters.
Failures are unrelated, let's merge