Skip to content

Commit

Permalink
Merge pull request torch#282 from nkoumchatzky/master
Browse files Browse the repository at this point in the history
Change lua_isstring check in torch_random
  • Loading branch information
clementfarabet committed Jul 2, 2015
2 parents 25206fe + e185fe2 commit b30f4bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion TensorMath.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int torch_NAME(lua_State *L)
else if(narg >= 2 && (tname = torch_istensortype(L, luaT_typename(L, 2)))) /* second? */
{
}
else if(narg >= 1 && lua_isstring(L, narg)
else if(narg >= 1 && lua_type(L, narg) == LUA_TSTRING
&& (tname = torch_istensortype(L, lua_tostring(L, narg)))) /* do we have a valid tensor type string then? */
{
lua_remove(L, -2);
Expand Down

0 comments on commit b30f4bd

Please sign in to comment.