Open2

torch.cross のONNXエクスポートのワークアラウンド

PINTOPINTO
        # 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))