Yehor commited on
Commit
a7810c9
·
1 Parent(s): 1f19335
Files changed (1) hide show
  1. radtts.py +17 -11
radtts.py CHANGED
@@ -688,9 +688,7 @@ class RADTTS(torch.nn.Module):
688
 
689
  if dur is None:
690
  # get token durations
691
- z_dur = torch.tensor(
692
- torch.empty(batch_size, 1, n_tokens), dtype=torch.float32
693
- )
694
  if use_cuda:
695
  z_dur = z_dur.cuda()
696
 
@@ -746,10 +744,14 @@ class RADTTS(torch.nn.Module):
746
  if f0 is None:
747
  n_f0_feature_channels = 2 if self.use_first_order_features else 1
748
 
749
- z_f0 = torch.tensor(
750
- torch.randn(batch_size, n_f0_feature_channels, max_n_frames)
751
- * sigma_f0,
752
- dtype=torch.float32,
 
 
 
 
753
  )
754
  if use_cuda:
755
  z_f0 = z_f0.cuda()
@@ -772,10 +774,14 @@ class RADTTS(torch.nn.Module):
772
  if energy_avg is None:
773
  n_energy_feature_channels = 2 if self.use_first_order_features else 1
774
 
775
- z_energy_avg = torch.tensor(
776
- torch.randn(batch_size, n_energy_feature_channels, max_n_frames)
777
- * sigma_energy,
778
- dtype=torch.float32,
 
 
 
 
779
  )
780
 
781
  if use_cuda:
 
688
 
689
  if dur is None:
690
  # get token durations
691
+ z_dur = torch.empty(batch_size, 1, n_tokens, dtype=torch.float32)
 
 
692
  if use_cuda:
693
  z_dur = z_dur.cuda()
694
 
 
744
  if f0 is None:
745
  n_f0_feature_channels = 2 if self.use_first_order_features else 1
746
 
747
+ z_f0 = (
748
+ torch.randn(
749
+ batch_size,
750
+ n_f0_feature_channels,
751
+ max_n_frames,
752
+ dtype=torch.float32,
753
+ )
754
+ * sigma_f0
755
  )
756
  if use_cuda:
757
  z_f0 = z_f0.cuda()
 
774
  if energy_avg is None:
775
  n_energy_feature_channels = 2 if self.use_first_order_features else 1
776
 
777
+ z_energy_avg = (
778
+ torch.randn(
779
+ batch_size,
780
+ n_energy_feature_channels,
781
+ max_n_frames,
782
+ dtype=torch.float32,
783
+ )
784
+ * sigma_energy
785
  )
786
 
787
  if use_cuda: