Skip to content

How does tract_onnx::tract_hir::ops::cnn::Conv implement Op ? #823

Answered by kali
alexander-camuto asked this question in Q&A
Discussion options

You must be logged in to vote

Conv is defined in hir/src/ops/cnn/conv.rs. It does not directly implements Op, it is an Expansion instead. Defined in hir/src/ops/expandable.rs. It is wrapped in Box<dyn Expansion> which does implements Op and EvalOp in a very inneficient way (by generic an equivalent network to eval itself).

When you call into_typed (directly or through into_declutter or into_optimized) the expansion expands to actualy convolution operators (most likely ConvUnary from tract-core).

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@alexander-camuto
Comment options

Answer selected by alexander-camuto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants