larq / compute-engine

Highly optimized inference engine for Binarized Neural Networks
https://docs.larq.dev/compute-engine
Apache License 2.0
240 stars 33 forks source link

Remove anonymous namespaces in MLIR transforms #768

Closed Tombana closed 1 year ago

Tombana commented 1 year ago

What do these changes do?

This fixes the following type of runtime errors when the converter is built with clang.

LLVM ERROR: TypeID::get<mlir::TFL::(anonymous namespace)::FusePadding>(): Using TypeID on a class with an anonymous namespace requires an explicit TypeID definition. The implicit fallback uses string name, which does not guarantee uniqueness in anonymous contexts. Define an explicit TypeID instantiation for this type using `MLIR_DECLARE_EXPLICIT_TYPE_ID`/`MLIR_DEFINE_EXPLICIT_TYPE_ID` or `MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID`.