Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
0d6e3f12
Commit
0d6e3f12
authored
Apr 29, 2016
by
Davis King
Browse files
Made the multi_device_tensor_averager not assume the size of the tensors is
known at set() time.
parent
b85688ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
8 deletions
+1
-8
dlib/dnn/tensor_tools.h
dlib/dnn/tensor_tools.h
+1
-8
No files found.
dlib/dnn/tensor_tools.h
View file @
0d6e3f12
...
@@ -1067,14 +1067,6 @@ namespace dlib { namespace tt
...
@@ -1067,14 +1067,6 @@ namespace dlib { namespace tt
epa
.
emplace_back
(
new
enable_peer_access
(
*
g
[
0
],
*
g
[
i
]));
epa
.
emplace_back
(
new
enable_peer_access
(
*
g
[
0
],
*
g
[
i
]));
}
}
}
}
// If there are multiple groups then we need to use the accum_buffer space
// when talking across groups. So allocate that buffer now.
if
(
accessible_groups
.
size
()
>
1
)
{
raii_set_device
set_dev
(
*
accessible_groups
[
0
][
0
]);
accum_buffer
.
copy_size
(
*
accessible_groups
[
0
][
0
]);
}
}
}
void
average
()
void
average
()
...
@@ -1108,6 +1100,7 @@ namespace dlib { namespace tt
...
@@ -1108,6 +1100,7 @@ namespace dlib { namespace tt
{
{
tensor
&
total_avg
=
*
accessible_groups
[
0
][
0
];
tensor
&
total_avg
=
*
accessible_groups
[
0
][
0
];
raii_set_device
set_dev
(
total_avg
);
raii_set_device
set_dev
(
total_avg
);
accum_buffer
.
copy_size
(
total_avg
);
// now we need to average things across groups
// now we need to average things across groups
for
(
size_t
i
=
1
;
i
<
accessible_groups
.
size
();
++
i
)
for
(
size_t
i
=
1
;
i
<
accessible_groups
.
size
();
++
i
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment