torch: fix wrap