Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
32be2897
Unverified
Commit
32be2897
authored
Jan 29, 2024
by
Aarni Koskela
Committed by
GitHub
Jan 29, 2024
Browse files
Don't require scipy for regular use (#948)
parent
619e9b3b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
bitsandbytes/functional.py
bitsandbytes/functional.py
+8
-1
setup.py
setup.py
+5
-2
No files found.
bitsandbytes/functional.py
View file @
32be2897
...
...
@@ -233,8 +233,15 @@ def create_linear_map(signed=True, total_bits=8, add_zero=True):
l
=
values
.
numel
()
//
2
return
torch
.
Tensor
(
values
[:
l
].
tolist
()
+
[
0
]
*
gap
+
values
[
l
:].
tolist
())
def
create_normal_map
(
offset
=
0.9677083
,
use_extra_value
=
True
):
try
:
from
scipy.stats
import
norm
except
ImportError
as
ie
:
raise
ImportError
(
"Scipy is required for `create_normal_map`. "
"Install `bitsandbytes` with the `[test]` extra."
)
from
ie
if
use_extra_value
:
# one more positive value, this is an asymmetric type
...
...
setup.py
View file @
32be2897
...
...
@@ -29,8 +29,11 @@ setup(
url
=
"https://github.com/TimDettmers/bitsandbytes"
,
packages
=
find_packages
(),
package_data
=
{
""
:
libs
},
install_requires
=
[
'torch'
,
'numpy'
,
'scipy'
],
extras_require
=
{
'benchmark'
:
[
'pandas'
,
'matplotlib'
]},
install_requires
=
[
'torch'
,
'numpy'
],
extras_require
=
{
'benchmark'
:
[
'pandas'
,
'matplotlib'
],
'test'
:
[
'scipy'
],
},
long_description
=
read
(
"README.md"
),
long_description_content_type
=
"text/markdown"
,
classifiers
=
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment