forked from ShaoqingRen/SPP_net
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspp_layers_in_gpu.m
More file actions
24 lines (23 loc) · 813 Bytes
/
spp_layers_in_gpu.m
File metadata and controls
24 lines (23 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
function layers = spp_layers_in_gpu(layers)
% layers = spp_layers_in_gpu(layers)
% create each layers weight array in gpu
%
% AUTORIGHTS
% ---------------------------------------------------------
% Copyright (c) 2014, Shaoqing Ren
%
% This file is part of the SPP code and is available
% under the terms of the Simplified BSD License provided in
% LICENSE. Please retain this notice and LICENSE if you use
% this file (or any portion of it) in your project.
% ---------------------------------------------------------
for i = 1:length(layers)
if isempty(layers(i).weights)
continue;
end
layers(i).weights_gpu = layers(i).weights;
for j = 1:length(layers(i).weights)
layers(i).weights_gpu{j} = gpuArray(layers(i).weights{j});
end
end
end