'Time-frequency transform of times series along the last axis.
Parameters
X : array, shape (n_samples, n_channels, n_times)
The training data samples. The channel dimension can be zero- or
1-dimensional.
Returns
Xt : array, shape (n_samples, n_channels, n_frequencies, n_times)
The time-frequency transform of the data, where n_channels can be
zero- or 1-dimensional.'

def transform(self, X):

    shape = X.shape[1:(-1)]
    if (not shape):
        X = X[:, np.newaxis, :]
    Xt = _compute_tfr(X, self.frequencies, self.sfreq, self.method, self.n_cycles, True, self.time_bandwidth, self.use_fft, self.decim, self.output, self.n_jobs, self.verbose)
    if (not shape):
        Xt = Xt[:, 0, :]
    return Xt
