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
30c62962
Commit
30c62962
authored
Nov 17, 2016
by
Davis King
Browse files
Made non-const alias tensors convertible to const alias tensors.
parent
b19e139d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
dlib/dnn/tensor.h
dlib/dnn/tensor.h
+2
-0
dlib/dnn/tensor_abstract.h
dlib/dnn/tensor_abstract.h
+3
-0
No files found.
dlib/dnn/tensor.h
View file @
30c62962
...
...
@@ -566,6 +566,8 @@ namespace dlib
const
tensor
&
get
()
const
{
return
inst
;
}
operator
const
tensor
&
()
{
return
inst
;
}
alias_tensor_const_instance
(
const
alias_tensor_instance
&
item
)
:
inst
(
item
)
{}
private:
alias_tensor_instance
inst
;
...
...
dlib/dnn/tensor_abstract.h
View file @
30c62962
...
...
@@ -601,6 +601,9 @@ namespace dlib
public:
// non-const alias tensors are convertible to const ones.
alias_tensor_const_instance
(
const
alias_tensor_instance
&
item
);
// Methods that cast the alias to a tensor.
const
tensor
&
get
()
const
;
operator
const
tensor
&
();
...
...
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