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
29897305
Commit
29897305
authored
Jul 08, 2017
by
Davis King
Browse files
Work around funny name lookup rules for serialize() call.
parent
32fb83b3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
22 deletions
+24
-22
dlib/dnn/core.h
dlib/dnn/core.h
+24
-22
No files found.
dlib/dnn/core.h
View file @
29897305
...
...
@@ -2158,11 +2158,6 @@ namespace dlib
template
<
typename
net_type
,
typename
solver_type
>
friend
class
dnn_trainer
;
};
template
<
typename
LOSS_DETAILS
,
typename
SUBNET
>
void
serialize
(
const
add_loss_layer
<
LOSS_DETAILS
,
SUBNET
>&
item
,
std
::
ostream
&
out
);
template
<
typename
LOSS_DETAILS
,
typename
SUBNET
>
void
deserialize
(
add_loss_layer
<
LOSS_DETAILS
,
SUBNET
>&
item
,
std
::
istream
&
in
);
// ----------------------------------------------------------------------------------------
template
<
typename
LOSS_DETAILS
,
typename
SUBNET
>
...
...
@@ -2457,23 +2452,10 @@ namespace dlib
subnetwork
.
clean
();
}
friend
void
serialize
(
const
add_loss_layer
&
item
,
std
::
ostream
&
out
)
{
int
version
=
1
;
serialize
(
version
,
out
);
serialize
(
item
.
loss
,
out
);
serialize
(
item
.
subnetwork
,
out
);
}
friend
void
deserialize
(
add_loss_layer
&
item
,
std
::
istream
&
in
)
{
int
version
=
0
;
deserialize
(
version
,
in
);
if
(
version
!=
1
)
throw
serialization_error
(
"Unexpected version found while deserializing dlib::add_loss_layer."
);
deserialize
(
item
.
loss
,
in
);
deserialize
(
item
.
subnetwork
,
in
);
}
template
<
typename
T
,
typename
U
>
friend
void
serialize
(
const
add_loss_layer
<
T
,
U
>&
item
,
std
::
ostream
&
out
);
template
<
typename
T
,
typename
U
>
friend
void
deserialize
(
add_loss_layer
<
T
,
U
>&
item
,
std
::
istream
&
in
);
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
out
,
const
add_loss_layer
&
item
)
{
...
...
@@ -2506,6 +2488,26 @@ namespace dlib
resizable_tensor
temp_tensor
;
};
template
<
typename
LOSS_DETAILS
,
typename
SUBNET
>
void
serialize
(
const
add_loss_layer
<
LOSS_DETAILS
,
SUBNET
>&
item
,
std
::
ostream
&
out
)
{
int
version
=
1
;
serialize
(
version
,
out
);
serialize
(
item
.
loss
,
out
);
serialize
(
item
.
subnetwork
,
out
);
}
template
<
typename
LOSS_DETAILS
,
typename
SUBNET
>
void
deserialize
(
add_loss_layer
<
LOSS_DETAILS
,
SUBNET
>&
item
,
std
::
istream
&
in
)
{
int
version
=
0
;
deserialize
(
version
,
in
);
if
(
version
!=
1
)
throw
serialization_error
(
"Unexpected version found while deserializing dlib::add_loss_layer."
);
deserialize
(
item
.
loss
,
in
);
deserialize
(
item
.
subnetwork
,
in
);
}
template
<
typename
T
,
typename
U
>
struct
is_loss_layer_type
<
add_loss_layer
<
T
,
U
>>
:
std
::
true_type
{};
...
...
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