mirror of
https://github.com/davisking/dlib.git
synced 2024-11-01 10:14:53 +08:00
Made non-const alias tensors convertible to const alias tensors.
This commit is contained in:
parent
b19e139dea
commit
30c629624e
@ -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;
|
||||
|
||||
|
@ -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& ();
|
||||
|
Loading…
Reference in New Issue
Block a user