Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion larq_compute_engine/mlir/transforms/prepare_tf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ bool IsBinaryFilter(Attribute filter_attr) {
if (!filter_attr.isa<DenseElementsAttr>()) return false;
auto filter = filter_attr.cast<DenseElementsAttr>();

auto shape = filter_attr.getType().cast<ShapedType>().getShape();
auto filter_type = filter_attr.getType().cast<ShapedType>();
auto element_type = filter_type.getElementType();
if (!element_type.isF32()) return false;
auto shape = filter_type.getShape();
if (shape.size() != 4) return false;

for (std::size_t h = 0; h < shape[0]; ++h) {
Expand Down