4/11/2022

time-distributed dense (TDD, TimeDistributed) layer in PyTorch

 

refer to code:

..

import torch
m = torch.nn.Linear(256, 5)
#batch, sequence(time), dim
input = torch.randn(100, 140, 256)
output = m(input) #100, 140, 256 -> 100, 140, 5
print(output.size())
#torch.Size([100, 140, 5])

..


Thank you.

www.marearts.com