How to use dmlc::optional<self defined struct> in dmlc::Parameter?
- Dominant language
- C++
- Stars
- 878
- Forks
- 526
- Avg merge
- 12d 19h
- Merged PRs (30d)
- 1
Description
I use struct definition like follow,
struct BlobProto : public dmlc::Parameter{
dmlc::optional sShape;
nnvm::Tuple> tupfData;
nnvm::Tuple> tupfDiff;
DMLC_DECLARE_PARAMETER(BlobProto) {
DMLC_DECLARE_FIELD(sShape)
.set_default(dmlc::optional< TShape >());
DMLC_DECLARE_FIELD(tupfData)
.set_default(nnvm::Tuple< dmlc::optional< float > >());
DMLC_DECLARE_FIELD(tupfDiff)
.set_default(nnvm::Tuple< dmlc::optional< float > >());
}
struct LayerParameter : public dmlc::Parameter< LayerParameter > {
...
nnvm::Tuple> tupBlobs;
...
DMLC_DECLARE_PARAMETER(LayerParameter) {
DMLC_DECLARE_FIELD(tupBlobs)
.set_default(nnvm::Tuple< dmlc::optional< BlobProto > >());
}
}
if I use DMLC_DECLARE_FIELD(tupBlobs), it will be error.
if I don't use DMLC_DECLARE_FIELD(tupBlobs), i can't use dmlc::JSONWriter to print structure.
how to make it work?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.