Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/torch7.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Harley <tim.harley.uk@gmail.com>2015-04-22 19:08:51 +0300
committerTim Harley <tim.harley.uk@gmail.com>2015-04-22 19:19:23 +0300
commit649dccd51e2b11dbf7fb06e31e8caba73b348f6c (patch)
treeefb84f916aa1261c10d7a13965afb7181a187d2f /generic
parente033da62a43228bb1d90eaf2df48ef9c093ebb25 (diff)
Add elementSize method to *Storage types.
Diffstat (limited to 'generic')
-rw-r--r--generic/Storage.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/generic/Storage.c b/generic/Storage.c
index 9dc3ba2..7de1828 100644
--- a/generic/Storage.c
+++ b/generic/Storage.c
@@ -104,6 +104,12 @@ static int torch_Storage_(fill)(lua_State *L)
return 1;
}
+static int torch_Storage_(elementSize)(lua_State *L)
+{
+ lua_pushnumber(L, THStorage_(elementSize)());
+ return 1;
+}
+
static int torch_Storage_(__len__)(lua_State *L)
{
THStorage *storage = luaT_checkudata(L, 1, torch_Storage);
@@ -211,6 +217,7 @@ static const struct luaL_Reg torch_Storage_(_) [] = {
{"retain", torch_Storage_(retain)},
{"free", torch_Storage_(free)},
{"size", torch_Storage_(__len__)},
+ {"elementSize", torch_Storage_(elementSize)},
{"__len__", torch_Storage_(__len__)},
{"__newindex__", torch_Storage_(__newindex__)},
{"__index__", torch_Storage_(__index__)},