mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 10:02:22 +00:00
Fix an error introduced by supporting torchscript for torch 1.6.0 (#434)
This commit is contained in:
parent
d53f69108f
commit
ab788980c9
@ -56,10 +56,10 @@ class ActivationBalancerFunction(torch.autograd.Function):
|
||||
# sum_dims = [d for d in range(x.ndim) if d != channel_dim]
|
||||
# The above line is not torch scriptable for torch 1.6.0
|
||||
# torch.jit.frontend.NotSupportedError: comprehension ifs not supported yet: # noqa
|
||||
sum_dims = 0
|
||||
sum_dims = []
|
||||
for d in range(x.ndim):
|
||||
if d != channel_dim:
|
||||
sum_dims += d
|
||||
sum_dims.append(d)
|
||||
|
||||
xgt0 = x > 0
|
||||
proportion_positive = torch.mean(
|
||||
|
Loading…
x
Reference in New Issue
Block a user