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
hehl2
Torchaudio
Commits
e3540625
"sgl-kernel/vscode:/vscode.git/clone" did not exist on "f3817cb0b20595ac9abf77855cc9e0883d72c194"
Commit
e3540625
authored
Jul 26, 2019
by
jamarshon
Committed by
cpuhrsch
Jul 26, 2019
Browse files
Merge branch 'v0.2.0' into master (#162)
parent
3f122ae1
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
68 additions
and
4 deletions
+68
-4
.gitignore
.gitignore
+1
-0
build_tools/travis/install.sh
build_tools/travis/install.sh
+1
-1
requirements.txt
requirements.txt
+3
-1
setup.py
setup.py
+62
-2
torchaudio/__init__.py
torchaudio/__init__.py
+1
-0
No files found.
.gitignore
View file @
e3540625
...
...
@@ -108,3 +108,4 @@ ENV/
# Generated Files
test/assets/sinewave.wav
torchaudio/version.py
build_tools/travis/install.sh
View file @
e3540625
...
...
@@ -56,5 +56,5 @@ if [[ "$SKIP_TESTS" != "true" ]]; then
conda
install
--yes
pytorch-nightly-cpu
-c
pytorch
# TorchAudio CPP Extensions
p
ip
install
.
p
ython setup.py
install
fi
requirements.txt
View file @
e3540625
torch
>=1.1.0
# Optional for torchaudio.kaldi_io
numpy
kaldi_io
...
...
@@ -8,7 +10,7 @@ kaldi_io
flake8
# Used for comparison of outputs in tests
librosa
librosa
>=0.4.3
scipy
# Unit tests with pytest
...
...
setup.py
View file @
e3540625
#!/usr/bin/env python
import
os
import
platform
import
sys
import
subprocess
from
setuptools
import
setup
,
find_packages
from
torch.utils.cpp_extension
import
BuildExtension
,
CppExtension
...
...
@@ -10,6 +12,11 @@ def check_env_flag(name, default=''):
return
os
.
getenv
(
name
,
default
).
upper
()
in
set
([
'ON'
,
'1'
,
'YES'
,
'TRUE'
,
'Y'
])
DEBUG
=
check_env_flag
(
'DEBUG'
)
IS_WHEEL
=
check_env_flag
(
'IS_WHEEL'
)
IS_CONDA
=
check_env_flag
(
'IS_CONDA'
)
print
(
'DEBUG:'
,
DEBUG
,
'IS_WHEEL:'
,
IS_WHEEL
,
'IS_CONDA:'
,
IS_CONDA
)
eca
=
[]
ela
=
[]
if
DEBUG
:
...
...
@@ -19,6 +26,56 @@ if DEBUG:
eca
+=
[
'-O0'
,
'-g'
]
ela
+=
[
'-O0'
,
'-g'
]
libraries
=
[]
include_dirs
=
[]
extra_objects
=
[]
if
IS_WHEEL
:
audio_path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
include_dirs
+=
[
os
.
path
.
join
(
audio_path
,
'third_party/flac/include'
)]
include_dirs
+=
[
os
.
path
.
join
(
audio_path
,
'third_party/lame/include'
)]
include_dirs
+=
[
os
.
path
.
join
(
audio_path
,
'third_party/sox/include'
)]
# proper link order (sox, flac, lame)
extra_objects
+=
[
os
.
path
.
join
(
audio_path
,
'third_party/sox/lib/libsox.a'
)]
extra_objects
+=
[
os
.
path
.
join
(
audio_path
,
'third_party/flac/lib/libFLAC.a'
)]
extra_objects
+=
[
os
.
path
.
join
(
audio_path
,
'third_party/lame/lib/libmp3lame.a'
)]
else
:
libraries
+=
[
'sox'
]
if
IS_CONDA
:
# We want $PREFIX/include for conda (for sox.h)
lib_path
=
os
.
path
.
dirname
(
sys
.
executable
)
include_dirs
+=
[
os
.
path
.
join
(
os
.
path
.
dirname
(
lib_path
),
'include'
)]
# Creating the version file
cwd
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
version
=
'0.2.0a0'
sha
=
'Unknown'
try
:
sha
=
subprocess
.
check_output
([
'git'
,
'rev-parse'
,
'HEAD'
],
cwd
=
cwd
).
decode
(
'ascii'
).
strip
()
except
Exception
:
pass
if
os
.
getenv
(
'TORCHAUDIO_BUILD_VERSION'
):
assert
os
.
getenv
(
'TORCHAUDIO_BUILD_NUMBER'
)
is
not
None
build_number
=
int
(
os
.
getenv
(
'TORCHAUDIO_BUILD_NUMBER'
))
version
=
os
.
getenv
(
'TORCHAUDIO_BUILD_VERSION'
)
if
build_number
>
1
:
version
+=
'.post'
+
str
(
build_number
)
elif
sha
!=
'Unknown'
:
version
+=
'+'
+
sha
[:
7
]
print
(
'-- Building version '
+
version
)
version_path
=
os
.
path
.
join
(
cwd
,
'torchaudio'
,
'version.py'
)
with
open
(
version_path
,
'w'
)
as
f
:
f
.
write
(
"__version__ = '{}'
\n
"
.
format
(
version
))
f
.
write
(
"git_version = {}
\n
"
.
format
(
repr
(
sha
)))
setup
(
name
=
"torchaudio"
,
version
=
"0.2"
,
...
...
@@ -35,7 +92,8 @@ setup(
"Operating System :: Microsoft :: Windows"
,
"Operating System :: POSIX"
,
"Programming Language :: C++"
,
"Programming Language :: Python 3"
,
"Programming Language :: Python :: 2.7"
,
"Programming Language :: Python :: 3"
,
"Programming Language :: Python :: Implementation :: CPython"
,
"Topic :: Multimedia :: Sound/Audio"
,
"Topic :: Scientific/Engineering :: Artificial Intelligence"
...
...
@@ -46,8 +104,10 @@ setup(
CppExtension
(
'_torch_sox'
,
[
'torchaudio/torch_sox.cpp'
],
libraries
=
[
'sox'
],
libraries
=
libraries
,
include_dirs
=
include_dirs
,
extra_compile_args
=
eca
,
extra_objects
=
extra_objects
,
extra_link_args
=
ela
),
],
cmdclass
=
{
'build_ext'
:
BuildExtension
},
...
...
torchaudio/__init__.py
View file @
e3540625
...
...
@@ -4,6 +4,7 @@ import os.path
import
torch
import
_torch_sox
from
.version
import
__version__
,
git_version
from
torchaudio
import
transforms
,
datasets
,
kaldi_io
,
sox_effects
,
legacy
,
compliance
...
...
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