Open2022/05/14にコメント追加2torch.cross のONNXエクスポートのワークアラウンドPyTorchONNXPINTO2022/05/14https://github.com/onnx/onnx/issues/2683 PINTO2022/05/14 # normal = tu.cross(tv, dim=3) normal = torch.stack(( tu[:,:,:,1]*tv[:,:,:,2] - tu[:,:,:,2]*tv[:,:,:,1], tu[:,:,:,2]*tv[:,:,:,0] - tu[:,:,:,0]*tv[:,:,:,2], tu[:,:,:,0]*tv[:,:,:,1] - tu[:,:,:,1]*tv[:,:,:,0]), dim=3) # print("cross all close", torch.allclose(normal, normal2))
PINTO2022/05/14 # normal = tu.cross(tv, dim=3) normal = torch.stack(( tu[:,:,:,1]*tv[:,:,:,2] - tu[:,:,:,2]*tv[:,:,:,1], tu[:,:,:,2]*tv[:,:,:,0] - tu[:,:,:,0]*tv[:,:,:,2], tu[:,:,:,0]*tv[:,:,:,1] - tu[:,:,:,1]*tv[:,:,:,0]), dim=3) # print("cross all close", torch.allclose(normal, normal2))