memcpy is super slow in cuda kernels....

This commit is contained in:
erikwijmans
2018-01-29 18:22:27 -05:00
parent 009c30e5e3
commit c4ddd6b099
7 changed files with 30 additions and 14 deletions
+4 -2
View File
@@ -128,13 +128,15 @@ if __name__ == "__main__":
from torch.autograd import Variable
import numpy as np
import torch.optim as optim
import torch.autograd.profiler as profiler
B = 2
N = 32
N = 2048
inputs = torch.randn(B, N, 9).cuda()
labels = torch.from_numpy(np.random.randint(0, 3, size=B)).cuda()
model = Pointnet2SSG(3)
model = Pointnet2MSG(3)
model.cuda()
optimizer = optim.Adam(model.parameters(), lr=1e-2)
model_fn = model_fn_decorator(nn.CrossEntropyLoss())