Skip to content

Use reshape instead of view #571

@vincentqb

Description

@vincentqb

Following #409, view is used instead of reshape. When running the tutorial, the following error occurs as mentioned here:

Apr 22 18:46:35 Traceback (most recent call last):
Apr 22 18:46:35   File "/opt/conda/lib/python3.6/site-packages/sphinx_gallery/gen_rst.py", line 394, in _memory_usage
Apr 22 18:46:35     out = func()
Apr 22 18:46:35   File "/opt/conda/lib/python3.6/site-packages/sphinx_gallery/gen_rst.py", line 382, in __call__
Apr 22 18:46:35     exec(self.code, self.globals)
Apr 22 18:46:35   File "/var/lib/jenkins/workspace/beginner_source/audio_preprocessing_tutorial.py", line 216, in <module>
Apr 22 18:46:35     computed = torchaudio.functional.compute_deltas(specgram, win_length=3)
Apr 22 18:46:35   File "/opt/conda/lib/python3.6/site-packages/torchaudio/functional.py", line 1304, in compute_deltas
Apr 22 18:46:35     specgram = specgram.view(1, -1, shape[-1])
Apr 22 18:46:35 RuntimeError: view size is not compatible with input tensor's size and stride (at least one dimension spans across two contiguous subspaces). Use .reshape(...) instead.

Workaround:

Proposed solution:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions