You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
clock_t start = clock();
torch::Tensor transform_tensor = torch::zeros({ 10000 });
for (size_t m = 0; m < 10000 m++)
transform_tensor[m] = int(m);
clock_t finish = clock();
And it takes 0.317s. If I assign 10,000 to an array or a vector, the time cost will be less.
Why tensor takes so much time? Can the time cost be decreased?
The text was updated successfully, but these errors were encountered:
holly1238
added
the
Tensors
Issues relating to tensors (generic issues/questions or specific tensor tutorials)
label
Jul 27, 2021
Closing as this has been asked long time ago and likely no longer relevant. If you have more questions, please post in https://dev-discuss.pytorch.org?
I just assign 10000 values to a tensor:
And it takes 0.317s. If I assign 10,000 to an array or a vector, the time cost will be less.
Why tensor takes so much time? Can the time cost be decreased?
The text was updated successfully, but these errors were encountered: