Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
DeepSpeech
提交
706a68bd
D
DeepSpeech
项目概览
PaddlePaddle
/
DeepSpeech
大约 1 年 前同步成功
通知
206
Star
8425
Fork
1598
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
245
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
DeepSpeech
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
245
Issue
245
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
706a68bd
编写于
3月 14, 2023
作者:
小湉湉
提交者:
GitHub
3月 14, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix dtype diff of last expand_v2 op of VITS (#3041)
上级
348064de
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
7 deletion
+8
-7
paddlespeech/t2s/models/vits/flow.py
paddlespeech/t2s/models/vits/flow.py
+5
-4
paddlespeech/t2s/models/vits/transform.py
paddlespeech/t2s/models/vits/transform.py
+1
-1
paddlespeech/t2s/modules/nets_utils.py
paddlespeech/t2s/modules/nets_utils.py
+2
-2
未找到文件。
paddlespeech/t2s/models/vits/flow.py
浏览文件 @
706a68bd
...
...
@@ -334,11 +334,12 @@ class ConvFlow(nn.Layer):
unnorm_widths
=
h
[...,
:
self
.
bins
]
/
denom
unnorm_heights
=
h
[...,
self
.
bins
:
2
*
self
.
bins
]
/
denom
unnorm_derivatives
=
h
[...,
2
*
self
.
bins
:]
xb
,
logdet_abs
=
piecewise_rational_quadratic_transform
(
xb
,
unnorm_widths
,
unnorm_heights
,
unnorm_derivatives
,
inputs
=
xb
,
unnorm
alized_widths
=
unnorm
_widths
,
unnorm
alized_heights
=
unnorm
_heights
,
unnorm
alized_derivatives
=
unnorm
_derivatives
,
inverse
=
inverse
,
tails
=
"linear"
,
tail_bound
=
self
.
tail_bound
,
)
...
...
paddlespeech/t2s/models/vits/transform.py
浏览文件 @
706a68bd
...
...
@@ -245,6 +245,6 @@ def rational_quadratic_spline(
def
_searchsorted
(
bin_locations
,
inputs
,
eps
=
1e-6
):
bin_locations
[...,
-
1
]
+=
eps
mask
=
inputs
[...,
None
]
>=
bin_locations
mask_int
=
paddle
.
cast
(
mask
,
'int64'
)
mask_int
=
paddle
.
cast
(
mask
,
dtype
=
'int64'
)
out
=
paddle
.
sum
(
mask_int
,
axis
=-
1
)
-
1
return
out
paddlespeech/t2s/modules/nets_utils.py
浏览文件 @
706a68bd
...
...
@@ -145,18 +145,18 @@ def make_pad_mask(lengths, xs=None, length_dim=-1):
bs
=
paddle
.
shape
(
lengths
)[
0
]
if
xs
is
None
:
maxlen
=
lengths
.
max
(
)
maxlen
=
paddle
.
cast
(
lengths
.
max
(),
dtype
=
bs
.
dtype
)
else
:
maxlen
=
paddle
.
shape
(
xs
)[
length_dim
]
seq_range
=
paddle
.
arange
(
0
,
maxlen
,
dtype
=
paddle
.
int64
)
# VITS 最后一个 expand 的位置
seq_range_expand
=
seq_range
.
unsqueeze
(
0
).
expand
([
bs
,
maxlen
])
seq_length_expand
=
lengths
.
unsqueeze
(
-
1
)
mask
=
seq_range_expand
>=
seq_length_expand
.
cast
(
seq_range_expand
.
dtype
)
if
xs
is
not
None
:
assert
paddle
.
shape
(
xs
)[
0
]
==
bs
,
(
paddle
.
shape
(
xs
)[
0
],
bs
)
if
length_dim
<
0
:
length_dim
=
len
(
paddle
.
shape
(
xs
))
+
length_dim
# ind = (:, None, ..., None, :, , None, ..., None)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录