-
Notifications
You must be signed in to change notification settings - Fork 66
PackedTensor #2258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
PackedTensor #2258
Conversation
❌ 3 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
01d6a50
to
6ae4ed2
Compare
self._dtype = dtype | ||
|
||
if isinstance(value, np.ndarray): | ||
if value.dtype == ml_dtypes.float4_e2m1fn or value.dtype == ml_dtypes.uint4 or value.dtype == ml_dtypes.int4: |
Check notice
Code scanning / lintrunner
PYLINT/R1714 Note
See consider-using-in. To disable, use # pylint: disable=consider-using-in
if isinstance(value, np.ndarray): | ||
if value.dtype == ml_dtypes.float4_e2m1fn or value.dtype == ml_dtypes.uint4 or value.dtype == ml_dtypes.int4: | ||
# Pack the array into uint8 | ||
value = _type_casting.pack_int4(value) |
Check failure
Code scanning / lintrunner
MYPY/assignment Error
using the ``.view()`` method. | ||
""" | ||
if isinstance(self._raw, np.ndarray) or _compatible_with_numpy(self._raw): | ||
array = self._raw.__array__(dtype) |
Check failure
Code scanning / lintrunner
PYLINT/E0602 Error
See undefined-variable. To disable, use # pylint: disable=undefined-variable
using the ``.view()`` method. | ||
""" | ||
if isinstance(self._raw, np.ndarray) or _compatible_with_numpy(self._raw): | ||
array = self._raw.__array__(dtype) |
Check failure
Code scanning / lintrunner
RUFF/F821 Error
See https://docs.astral.sh/ruff/rules/undefined-name
using the ``.view()`` method. | ||
""" | ||
if isinstance(self._raw, np.ndarray) or _compatible_with_numpy(self._raw): | ||
array = self._raw.__array__(dtype) |
Check failure
Code scanning / lintrunner
MYPY/name-defined Error
Fix #2250