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
962c6b0f
Unverified
Commit
962c6b0f
authored
Sep 03, 2019
by
Vincent QB
Committed by
GitHub
Sep 03, 2019
Browse files
Revert "Change Tensor.data<T> to Tensor.data_ptr<T> (#261)" (#265)
This reverts commit
860edcdb
.
parent
d26e112d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torchaudio/torch_sox.cpp
torchaudio/torch_sox.cpp
+3
-3
No files found.
torchaudio/torch_sox.cpp
View file @
962c6b0f
...
...
@@ -37,7 +37,7 @@ int64_t write_audio(SoxDescriptor& fd, at::Tensor tensor) {
std
::
vector
<
sox_sample_t
>
buffer
(
tensor
.
numel
());
AT_DISPATCH_ALL_TYPES
(
tensor
.
scalar_type
(),
"write_audio_buffer"
,
[
&
]
{
auto
*
data
=
tensor
.
data
_ptr
<
scalar_t
>
();
auto
*
data
=
tensor
.
data
<
scalar_t
>
();
std
::
copy
(
data
,
data
+
tensor
.
numel
(),
buffer
.
begin
());
});
...
...
@@ -64,7 +64,7 @@ void read_audio(
output
=
output
.
contiguous
();
AT_DISPATCH_ALL_TYPES
(
output
.
scalar_type
(),
"read_audio_buffer"
,
[
&
]
{
auto
*
data
=
output
.
data
_ptr
<
scalar_t
>
();
auto
*
data
=
output
.
data
<
scalar_t
>
();
std
::
copy
(
buffer
.
begin
(),
buffer
.
begin
()
+
samples_read
,
data
);
});
}
...
...
@@ -370,7 +370,7 @@ int build_flow_effects(const std::string& file_name,
const
int64_t
samples_read
=
sox_read
(
input
,
samples
.
data
(),
buffer_size
);
assert
(
samples_read
!=
nc
*
ns
&&
samples_read
!=
0
);
AT_DISPATCH_ALL_TYPES
(
otensor
.
scalar_type
(),
"effects_buffer"
,
[
&
]
{
auto
*
data
=
otensor
.
data
_ptr
<
scalar_t
>
();
auto
*
data
=
otensor
.
data
<
scalar_t
>
();
std
::
copy
(
samples
.
begin
(),
samples
.
begin
()
+
samples_read
,
data
);
});
// free buffer and close mem_read
...
...
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