From c8948ee0caee12178984c799ad7222b282d203c0 Mon Sep 17 00:00:00 2001 From: Davis King Date: Mon, 16 Nov 2015 18:29:09 -0500 Subject: [PATCH] Finished tensor_rand constructor. --- dlib/dnn/tensor_tools.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/dlib/dnn/tensor_tools.cpp b/dlib/dnn/tensor_tools.cpp index c26edd124..1a7cd6314 100644 --- a/dlib/dnn/tensor_tools.cpp +++ b/dlib/dnn/tensor_tools.cpp @@ -4,6 +4,7 @@ #define DLIB_TeNSOR_TOOLS_CPP_ #include "tensor_tools.h" +#include "../string.h" namespace dlib { namespace tt { @@ -40,10 +41,12 @@ namespace dlib { namespace tt tensor_rand:: tensor_rand( unsigned long long seed - ) - { - // TODO - } + ) +#ifdef DLIB_USE_CUDA + :rnd(seed){} +#else + {rnd.set_seed(cast_to_string(seed)); } +#endif void tensor_rand:: fill_gaussian (