From 5ab146ad231731b56919245bdcd1867311279f7d Mon Sep 17 00:00:00 2001 From: Dinesh Jayaraman Date: Wed, 26 Apr 2017 20:18:02 -0500 Subject: [PATCH] Cast index to CudaLongTensor (ReinforceCategorical.lua) multinomial() no longer accepts CudaTensor as index input. Casting to CudaLongTensor with this commit. --- ReinforceCategorical.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReinforceCategorical.lua b/ReinforceCategorical.lua index 7f66e21..15abf2e 100644 --- a/ReinforceCategorical.lua +++ b/ReinforceCategorical.lua @@ -11,7 +11,7 @@ local ReinforceCategorical, parent = torch.class("nn.ReinforceCategorical", "nn. function ReinforceCategorical:updateOutput(input) self.output:resizeAs(input) - self._index = self._index or ((torch.type(input) == 'torch.CudaTensor') and torch.CudaTensor() or torch.LongTensor()) + self._index = self._index or ((torch.type(input) == 'torch.CudaTensor') and torch.CudaLongTensor() or torch.LongTensor()) if self.stochastic or self.train ~= false then -- sample from categorical with p = input self._input = self._input or input.new()