We should have a common function call to validate attributes for different submitters to use:
func ValidateAttributes(definition map[string]*AttrMeta, ir *IR) (map[string]*attribute, error)
AttrMeta is a struct defines the type and documents for the attribute:
struct AttrMeta {
typ AttrType, // can be INT, STRING, LIST
doc string,
}
The definition is a mapping to define supported attributes for current submitter. e.g. for tensorflow submitter:
{
"train.epochs": &AttrMeta{AttrTypeInt, "number of epochs to train"},
"model.optimizer": &AttrMeta{AttrTypeString, "the name of optimizer to use"}
}
the submitter's codegen should call ValidateAttributes to validate attributes In the IR. And the document of the model using current codegen will be auto-generated.
We should have a common function call to validate attributes for different submitters to use:
AttrMetais a struct defines the type and documents for the attribute:The
definitionis a mapping to define supported attributes for current submitter. e.g. for tensorflow submitter:the submitter's
codegenshould callValidateAttributesto validate attributes In theIR. And the document of the model using currentcodegenwill be auto-generated.