We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0a66cb9 commit 0e73b14Copy full SHA for 0e73b14
gmodule.lua
@@ -177,17 +177,25 @@ function gModule:share(gm, ...)
177
end
178
179
function gModule:training()
180
+ parent.training(self)
181
for _, m in ipairs(self.modules) do
182
m:training()
183
184
185
186
function gModule:evaluate()
187
+ parent.evaluate(self)
188
189
m:evaluate()
190
191
192
193
+function gModule:applyToModules(func)
194
+ for _, m in ipairs(self.modules) do
195
+ func(m)
196
+ end
197
+end
198
+
199
--[[ Recursively applies type(type_str) to any tensors in the argument. If the
200
argument is a tensor, type(type_str) is applied; if the argument is an array,
201
this function recurses into it. ]]
0 commit comments