added torch implementation
Merge pull request #1 from dannydoomodin/test_mask

added torch implementation