akfidjeland/torch-totem — pull request #27 by timharley (2014-10-10 16:46:38+00:00)
Title: Standalone asserts

Pull out all totem asserts into `totem.asserts`.

> require 'totem'
> t = torch.ones(5)
> totem.asserts:assertTensorEq(t, t, 1e-5, "message"))

Also added some meta tests, so we can test the totem asserts (and by extension, totem itself) with totem :)

`totem.asserts` is a Tester object with patched `_success` and `_failure` methods. It may be cleaner to expose its methods as functions rather than methods (by forming closures around the object) to replace the `:` with a `.` in the code above. Let me know your thoughts.