mirror of https://github.com/coqui-ai/TTS.git
Remove variables
This commit is contained in:
parent
375d3c4b95
commit
91ac9d48f1
|
@ -74,7 +74,7 @@ class LJSpeechDataset(Dataset):
|
||||||
|
|
||||||
def get_dummy_data(self):
|
def get_dummy_data(self):
|
||||||
r"""Get a dummy input for testing"""
|
r"""Get a dummy input for testing"""
|
||||||
return torch.autograd.Variable(torch.ones(16, 143)).type(torch.LongTensor)
|
return torch.ones(16, 143).type(torch.LongTensor)
|
||||||
|
|
||||||
def collate_fn(self, batch):
|
def collate_fn(self, batch):
|
||||||
r"""
|
r"""
|
||||||
|
|
|
@ -72,10 +72,6 @@ class TWEBDataset(Dataset):
|
||||||
sample = {'text': text, 'wav': wav, 'item_idx': self.frames[idx][0]}
|
sample = {'text': text, 'wav': wav, 'item_idx': self.frames[idx][0]}
|
||||||
return sample
|
return sample
|
||||||
|
|
||||||
def get_dummy_data(self):
|
|
||||||
r"""Get a dummy input for testing"""
|
|
||||||
return torch.autograd.Variable(torch.ones(16, 143)).type(torch.LongTensor)
|
|
||||||
|
|
||||||
def collate_fn(self, batch):
|
def collate_fn(self, batch):
|
||||||
r"""
|
r"""
|
||||||
Perform preprocessing and create a final data batch:
|
Perform preprocessing and create a final data batch:
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import torch
|
import torch
|
||||||
from torch.autograd import Variable
|
|
||||||
from torch import nn
|
from torch import nn
|
||||||
from torch.nn import functional as F
|
from torch.nn import functional as F
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
import torch
|
import torch
|
||||||
from torch.autograd import Variable
|
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import torch
|
import torch
|
||||||
from torch.nn import functional
|
from torch.nn import functional
|
||||||
from torch.autograd import Variable
|
|
||||||
from torch import nn
|
from torch import nn
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +10,6 @@ def _sequence_mask(sequence_length, max_len=None):
|
||||||
batch_size = sequence_length.size(0)
|
batch_size = sequence_length.size(0)
|
||||||
seq_range = torch.arange(0, max_len).long()
|
seq_range = torch.arange(0, max_len).long()
|
||||||
seq_range_expand = seq_range.unsqueeze(0).expand(batch_size, max_len)
|
seq_range_expand = seq_range.unsqueeze(0).expand(batch_size, max_len)
|
||||||
seq_range_expand = Variable(seq_range_expand)
|
|
||||||
if sequence_length.is_cuda:
|
if sequence_length.is_cuda:
|
||||||
seq_range_expand = seq_range_expand.cuda()
|
seq_range_expand = seq_range_expand.cuda()
|
||||||
seq_length_expand = (sequence_length.unsqueeze(1)
|
seq_length_expand = (sequence_length.unsqueeze(1)
|
||||||
|
|
Loading…
Reference in New Issue