[shape_infer] Can we use explicit(full) template specialization for shape_infer() on static/partial shapes? #2
-
Generally we use a generic template code for shape_infer(), since StaticShape & PartialShape and StaticDimension & Dimension both support a common subset of API like:
So my question is, can we use explicit(full) template specialization for shape_infer()? template template <> |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I would suggest to try minimize specialized code Say, we have three specific lines of code for PartialShape and for StaticShape we should raise an exception there -- then lets create template helper function template <> |
Beta Was this translation helpful? Give feedback.
I would suggest to try minimize specialized code
Say, we have three specific lines of code for PartialShape and for StaticShape we should raise an exception there -- then lets create template helper function
template
helper (const T& in, T& out) {
// code for StaticShape
}
template <>
helperov::PartialShape(const ov::PartialShape& in, ov::PartialShape& out) {
// code specific to PartialShape
}