From 546fbca20c98f307bf5277a9556267ef6fc6fa55 Mon Sep 17 00:00:00 2001 From: Antonin Raffin Date: Mon, 3 Feb 2020 15:42:14 +0100 Subject: [PATCH] Copy by default --- torchy_baselines/common/buffers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torchy_baselines/common/buffers.py b/torchy_baselines/common/buffers.py index 3490f05..39fe24b 100644 --- a/torchy_baselines/common/buffers.py +++ b/torchy_baselines/common/buffers.py @@ -92,10 +92,10 @@ class BaseBuffer(object): """ raise NotImplementedError() - def to_torch(self, array: np.ndarray, copy: bool = False) -> th.Tensor: + def to_torch(self, array: np.ndarray, copy: bool = True) -> th.Tensor: """ Convert a numpy array to a PyTorch tensor. - Note: it does not copy the data by default + Note: it copies the data by default :param array: (np.ndarray) :param copy: (bool) Whether to copy or not the data