Hello, everyone
I have one question which I cannot solve
In PyTorch
when evaluating (not training),
codes are just like as below
output = np.full(len(testdata), -0.5)
model.eval()
with torch.no_grad():
for ii in range(len(testdata)):
data = torch.Tensor( testdata.iloc[…
output[ii] = model(data)
The above source code evaluates data per each sample
which is very very slow
My question is:
May I evaluate the testdata wholely at once?
That is,
model.eval()
with torch.no_grad():
data = … whole test data at once
output = copy.deepcopy(model(data)) //something like this
Can I do this? (which looks very fast)
Thank you in advance