Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
This reverts the "enclosed" class matching introduced in 9c75e57, which
broke matching against patterns. In contrast to the original implementation,
non-pattern strings are always matched fully against type names to minimize
surprises caused by e.g. common prefix.
|
|
This should bring a lot of benefit to code that uses torch.Tester (totem will
eventually become deprecated). Note that torch.Tester and totem.Tester once
shared the same code - this change brings it full circle.
At a glance, extra functionality includes:
- A general equality checker that accepts many different objects.
- Deep table comparison with precision checking.
- Stricter argument checking in using the test functions.
- Better output.
- torch.Storage comparison.
- Extra features for fine-grained control of testing.
|
|
|
|
|
|
allows class creation in a local namespace, while being backward-compatible
with luaT_newmetatable.
|
|
|
|
Fix the following cases (they raise error now):
torch.isTypeOf("string", "nn.Module")
require 'nn';
m = nn.Module()
m.name = "module"
nn.utils.recursiveType(m, "torch.FloatTensor")
|
|
The following code prints "true", but it should clearly print "false":
torch.class("TorchDummy")
torch.class("OtherTorchDummy")
obj = OtherTorchDummy()
=torch.isTypeOf(obj, TorchDummy)
Now the function returns true if the type given by the passed-in metatable either equals
typeSpec, or ends with ".<typeSpec>". For example, "ab.cd.ef" matches type specs
"ef", "cd.ef", and "ab.cd.ef", but not "f" or "d.ef".
|
|
This supports tensor types that are implemented using cdata.
These cdata objects do not have a unique metatable. Their
names are available through torch.typename.
|
|
Includes aliases to functions deprecated in Lua 5.2, such as
math.log10 and unpack, and loadstring
|
|
|
|
|
|
In my understanding, torch.isTensor should only return true if the tested object is an actual Tensor, not if it is the table torch.Tensor (or torch.FloatTensor, etc)
That means:
t = torch.FloatTensor
torch.isTensor(t) -- should be false
torch.isTensor(t()) -- should be true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
and makes things more clear
|
|
|
|
|