Yep, thans, that is exactly what I want. However, in my classification task, tmp_conv and step_init are incorporated to form the final feature representation as below. tmp_conv and h_init should requires_grad True or False?? I am newbie here, hope i don’t bother you.

criterion = nn.CrossEntropyLoss()
fea = func(step_init,tmp_conv)
loss = criterion(fea, labels)

Here func is some sort of function