mirror of
https://github.com/w-okada/voice-changer.git
synced 2025-02-03 00:33:57 +03:00
test
This commit is contained in:
parent
15fefdf5c4
commit
1a2220bfe4
@ -10,6 +10,7 @@ from voice_changer.RVC.inferencer.WebUIInferencer import WebUIInferencer
|
||||
from voice_changer.RVC.inferencer.WebUIInferencerNono import WebUIInferencerNono
|
||||
from voice_changer.RVC.inferencer.VorasInferencebeta import VoRASInferencer
|
||||
|
||||
|
||||
class InferencerManager:
|
||||
currentInferencer: Inferencer | None = None
|
||||
|
||||
|
@ -94,7 +94,8 @@ def subsequent_mask(length):
|
||||
return mask
|
||||
|
||||
|
||||
@torch.jit.script
|
||||
# @torch.jit.script
|
||||
@torch.jit._script_if_tracing
|
||||
def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels):
|
||||
n_channels_int = n_channels[0]
|
||||
in_act = input_a + input_b
|
||||
|
@ -23,9 +23,7 @@ def convert_pad_shape(pad_shape):
|
||||
def kl_divergence(m_p, logs_p, m_q, logs_q):
|
||||
"""KL(P||Q)"""
|
||||
kl = (logs_q - logs_p) - 0.5
|
||||
kl += (
|
||||
0.5 * (torch.exp(2.0 * logs_p) + ((m_p - m_q) ** 2)) * torch.exp(-2.0 * logs_q)
|
||||
)
|
||||
kl += 0.5 * (torch.exp(2.0 * logs_p) + ((m_p - m_q) ** 2)) * torch.exp(-2.0 * logs_q)
|
||||
return kl
|
||||
|
||||
|
||||
@ -73,12 +71,8 @@ def rand_slice_segments(x, x_lengths, segment_size=4, ids_str=None):
|
||||
def get_timing_signal_1d(length, channels, min_timescale=1.0, max_timescale=1.0e4):
|
||||
position = torch.arange(length, dtype=torch.float)
|
||||
num_timescales = channels // 2
|
||||
log_timescale_increment = math.log(float(max_timescale) / float(min_timescale)) / (
|
||||
num_timescales - 1
|
||||
)
|
||||
inv_timescales = min_timescale * torch.exp(
|
||||
torch.arange(num_timescales, dtype=torch.float) * -log_timescale_increment
|
||||
)
|
||||
log_timescale_increment = math.log(float(max_timescale) / float(min_timescale)) / (num_timescales - 1)
|
||||
inv_timescales = min_timescale * torch.exp(torch.arange(num_timescales, dtype=torch.float) * -log_timescale_increment)
|
||||
scaled_time = position.unsqueeze(0) * inv_timescales.unsqueeze(1)
|
||||
signal = torch.cat([torch.sin(scaled_time), torch.cos(scaled_time)], 0)
|
||||
signal = F.pad(signal, [0, 0, 0, channels % 2])
|
||||
@ -103,7 +97,8 @@ def subsequent_mask(length):
|
||||
return mask
|
||||
|
||||
|
||||
@torch.jit.script
|
||||
# @torch.jit.script
|
||||
@torch.jit._script_if_tracing
|
||||
def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels):
|
||||
n_channels_int = n_channels[0]
|
||||
in_act = input_a + input_b
|
||||
|
@ -121,7 +121,8 @@ def subsequent_mask(length):
|
||||
return mask
|
||||
|
||||
|
||||
@torch.jit.script
|
||||
#@torch.jit.script
|
||||
@torch.jit._script_if_tracing
|
||||
def fused_add_tanh_sigmoid_multiply(input_a, input_b, n_channels):
|
||||
n_channels_int = n_channels[0]
|
||||
in_act = input_a + input_b
|
||||
|
Loading…
Reference in New Issue
Block a user