Commit 309f4d21 authored by Alexis Brenon's avatar Alexis Brenon
Browse files

馃殤 Fix use_gpu dumping

parent 488259f8
......@@ -63,7 +63,7 @@ function class:__init(args, dump)
args = args or {}; dump = dump or {}
--- Does the agent must use GPU or not?
self.use_gpu = package.loaded["cutorch"]
local use_gpu = package.loaded["cutorch"]
--- Function to convert tensors if necessary.
--
-- This function must be called to convert tensors/network to the appropriate
......@@ -71,7 +71,7 @@ function class:__init(args, dump)
-- inconsistent types
-- @tfield func self._convert_tensor
self._convert_tensor = nil
if self.use_gpu then
if use_gpu then
self._convert_tensor = function(t) return t:cuda() end
else
local default_type = torch.getdefaulttensortype()
......
......@@ -76,7 +76,7 @@ local class, super = torch.class('_ExperiencePool', 'ArcadesComponent', module)
function class:__init(args, dump)
super.__init(self, args, dump)
args = args or {}; dump = dump or {}
self.use_gpu = package.loaded["cutorch"]
local use_gpu = package.loaded["cutorch"]
--- Function to convert tensors if necessary.
--
-- This function must be called to convert tensors/network to the appropriate
......@@ -84,7 +84,7 @@ function class:__init(args, dump)
-- inconsistent types
-- @tfield func self._convert_tensor
self._convert_tensor = nil
if self.use_gpu then
if use_gpu then
self._convert_tensor = function(t) return t:cuda() end
else
local default_type = torch.getdefaulttensortype()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment