Edit: I should have known that Torch would already have covered it