Skip to content

Commit 0b82271

Browse files
committed
FastOpt specialisation for models::usage
1 parent e8a1a25 commit 0b82271

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/models/model_base.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ enum struct usage { raw, training, scoring, translation, embedding };
1414

1515
YAML_REGISTER_TYPE(marian::models::usage, int)
1616

17+
// 'FASTOPT_REGISTER_TYPE'
18+
#if FASTOPT
19+
namespace marian {
20+
namespace fastopt_helpers {
21+
22+
template <>
23+
struct As<marian::models::usage> {
24+
static marian::models::usage apply(const FastOpt& node) {
25+
return static_cast<marian::models::usage>(As<int>::apply(node));
26+
}
27+
};
28+
} // namespace fastopt_helpers
29+
} // namespace marian
30+
#endif
31+
1732
namespace marian {
1833
namespace models {
1934

0 commit comments

Comments
 (0)