Optimize exposure autoencoder distributed training
This commit is contained in:
@@ -232,7 +232,8 @@ class TimesNetBlock(nn.Module):
|
||||
amplitude[0] = 0.0
|
||||
k = min(self.top_k, amplitude.numel() - 1)
|
||||
weights, indices = torch.topk(amplitude, k=k)
|
||||
periods = [max(1, T // int(idx.item())) for idx in indices]
|
||||
# One device synchronization per block instead of one per selected period.
|
||||
periods = [max(1, T // int(idx)) for idx in indices.tolist()]
|
||||
return periods, weights.to(dtype=x.dtype, device=x.device)
|
||||
|
||||
def _period_branch(self, x: torch.Tensor, period: int) -> torch.Tensor:
|
||||
|
||||
Reference in New Issue
Block a user