# SPDX-License-Identifier: Apache-2.0 """CPU fp32 reference of BEVDet (Autoware tensorrt_bevdet): the ground truth every PCC / output-agreement gate compares against (PLAN.md 0.3 item 1; research/bevdet/SPEC.md section 6). Layout (importable without ttnn; torch / onnx are imported inside the functions that need them): - ``config.py`` the Autoware model yaml + node parameters this port reproduces, each with its source line. - ``weights.py`` ``BEVDetWeights``: ``bevdet_one_lt_d.onnx`` parsed as data with the vendored ``ttaw.weights`` (initializers addressed by their consuming node; conv attributes from the graph), plus a graph check that the file is the deployed network. - ``model.py`` ``BEVDetNet``: the plugin-free network in torch fp32 with per-module taps (image encoder: ResNet-50, CustomFPN, camera-aware DepthNet; BEV decoder: CustomResNet, FPN_LSS, CenterHead). - ``plugins.py`` the BEVPool / AlignBEV / GatherBEV TensorRT plugins in torch fp32 (vendor fp32 semantics). - ``port_form.py`` the TT port's exact rewrites (camera gates with the BN1d fold, ASPP 1x3, GAP bias, depth softmax padded to 128, merged CenterHead) with torch emulations proven against the deployed form. - ``pipeline.py`` ``BEVDetReference``: the end-to-end frame (stateless ``run_frame`` and the stateful, API-equivalent ``__call__``) on top of ``host`` (pre-processing, tables, temporal state, NMS). - ``ort.py`` the ONNX Runtime oracle: the two plugin-free sub-graphs of the deployed file (research and tests only; onnxruntime is NOT a runtime dependency of the image). The ``to_dict()`` of this reference's output on the shipped sample is stored as ``samples/.reference.json``: ``server/smoke_test.py`` compares the served output with it. """