-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[xdoctest] reformat example code with google style in No.12-No.15 #56210
Conversation
... audio, label = esc50_dataset[idx] | ||
... # do something with audio, label | ||
... print(audio.shape, label) | ||
... # [audio_data_length] , label_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里可以有输出~ 另外,这行最好也保留吧,有助于理解输出的格式~
... print(audio.shape, label) | ||
... # [feature_dim, length] , label_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
... print(audio.shape, label) | ||
... # [audio_data_length] , label_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里检查失败了,可能是,TESS 的数据集每段长度不一样,而 _get_data 方法的 os.walk 不能保证每次 split 的数据一样,所以输出的 audio_data_length 不一样~
@SigureMo 帮忙看看是不是可以用 skip 跳过这段的检查?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
skip 吧,仅对输出 skip,或者不打印输出也可以
... print(audio.shape, label) | ||
... # [feature_dim, num_frames] , label_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
>>> wav_path = "./test.wav" | ||
|
||
>>> current_backend = paddle.audio.backends.get_current_backend() | ||
>>> print(current_backend) # wave_backend, the default backend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以加个输出 ~
# default backends is ['wave_backend'] | ||
# backends is ['wave_backend', 'soundfile'], if have installed paddleaudio >= 1.0.2 | ||
>>> current_backend = paddle.audio.backends.get_current_backend() | ||
>>> print(current_backend) # wave_backend, the default backend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
>>> wav_path = "./test.wav" | ||
|
||
>>> current_backend = paddle.audio.backends.get_current_backend() | ||
>>> print(current_backend) # wave_backend, the default backend. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTMeow 🐾
PR types
Others
PR changes
Others
Description
修改如下文件的示例代码为新的格式,并通过 xdoctest 检查:
@sunzhongkai588 @SigureMo @megemini