diff options
author | koray kavukcuoglu <koray@kavukcuoglu.org> | 2015-09-07 17:41:50 +0300 |
---|---|---|
committer | koray kavukcuoglu <koray@kavukcuoglu.org> | 2015-09-07 17:41:50 +0300 |
commit | 025e4b70a62dd4eade644c3e06502f071c80e37a (patch) | |
tree | b62a51c7cf07dd9ddfbcb9f1b77840247a8cc691 | |
parent | 1c43c984763e3942e0fe823305111d886090008e (diff) | |
parent | 3a830dffab96f80adc01e422b860494ef31fa374 (diff) |
Merge pull request #80 from d11/isTensor
Replace utils.istensor with torch.isTensor.
-rw-r--r-- | gmodule.lua | 2 | ||||
-rw-r--r-- | init.lua | 2 | ||||
-rw-r--r-- | nesting.lua | 2 | ||||
-rw-r--r-- | node.lua | 2 | ||||
-rw-r--r-- | utils.lua | 7 |
5 files changed, 4 insertions, 11 deletions
diff --git a/gmodule.lua b/gmodule.lua index 79f3033..41ae384 100644 --- a/gmodule.lua +++ b/gmodule.lua @@ -1,7 +1,7 @@ local nesting = paths.dofile('nesting.lua') local utils = paths.dofile('utils.lua') -local istensor = utils.istensor +local istensor = torch.isTensor local istable = utils.istable local istorchclass = utils.istorchclass @@ -10,7 +10,7 @@ torch.include('nngraph','ModuleFromCriterion.lua') -- handy functions local utils = paths.dofile('utils.lua') -local istensor = utils.istensor +local istensor = torch.isTensor local istable = utils.istable local istorchclass = utils.istorchclass diff --git a/nesting.lua b/nesting.lua index 0a61b36..18899c1 100644 --- a/nesting.lua +++ b/nesting.lua @@ -2,7 +2,7 @@ local nesting = {} local utils = paths.dofile('utils.lua') -local istensor = utils.istensor +local istensor = torch.isTensor -- Creates a clone of a tensor or of a table with tensors. function nesting.cloneNested(obj) @@ -1,6 +1,6 @@ local utils = paths.dofile('utils.lua') -local istensor = utils.istensor +local istensor = torch.isTensor local istable = utils.istable local istorchclass = utils.istorchclass require 'debug' @@ -1,12 +1,5 @@ local utils = {} -function utils.istensor(x) - if torch.typename(x) and torch.typename(x):find('Tensor') then - return true - end - return false -end - function utils.istorchclass(x) return type(x) == 'table' and torch.typename(x) end |