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
Torchaudio
Commits
2db284c4
Commit
2db284c4
authored
Mar 12, 2018
by
Peter Goldsborough
Committed by
Soumith Chintala
Apr 25, 2018
Browse files
Nits
parent
c340a8d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
2 deletions
+1
-2
torchaudio/torch_sox.cpp
torchaudio/torch_sox.cpp
+1
-1
torchaudio/torch_sox.h
torchaudio/torch_sox.h
+0
-1
No files found.
torchaudio/torch_sox.cpp
View file @
2db284c4
...
...
@@ -38,7 +38,7 @@ int read_audio_file(const std::string& file_name, at::Tensor output) {
output
.
resize_
({
samples_read
/
number_of_channels
,
number_of_channels
});
output
=
output
.
contiguous
();
AT_DISPATCH_ALL_TYPES
(
output
.
type
(),
"
write
_audio_buffer"
,
[
&
]
{
AT_DISPATCH_ALL_TYPES
(
output
.
type
(),
"
read
_audio_buffer"
,
[
&
]
{
auto
*
data
=
output
.
data
<
scalar_t
>
();
std
::
copy
(
buffer
.
begin
(),
buffer
.
begin
()
+
samples_read
,
data
);
});
...
...
torchaudio/torch_sox.h
View file @
2db284c4
#include <string>
#include <tuple>
namespace
at
{
struct
Tensor
;
...
...
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