In elem.lua line 14, ctypes' getfunc is indexed by its free function address. In elem.lua line 101, different tensor types' getfunc are indexed by their free function address. However, their free function address are same, as a result different tensor types will have the same getfunc as THByteTensor. In line 122, the upvalue "tensor_type_id" is torch.ByteTensor, so the returned tensor is always ByteTensor.
Hi,
In elem.lua line 14, ctypes' getfunc is indexed by its free function address. In elem.lua line 101, different tensor types' getfunc are indexed by their free function address. However, their free function address are same, as a result different tensor types will have the same getfunc as THByteTensor. In line 122, the upvalue "tensor_type_id" is torch.ByteTensor, so the returned tensor is always ByteTensor.
Thanks,