You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unreachable fallback. Per the ONNX spec, a Conv node always has at least 2 inputs (X, W); the optional bias is a 3rd input. So len(conv.inputs) > 1 is true for every valid Conv node, bias or not — the else branch (meant for bias-less convs) can never execute. The correct check is > 2.
Broken if reached. Even after fixing the condition, the fallback produces a raw np.zeros(...) array, but the following line treats it as an object with a .values attribute (matching onnx_graphsurgeon.Constant):
A plain numpy.ndarray has no .values attribute, so this raises AttributeError: 'numpy.ndarray' object has no attribute 'values'.
Net effect: fuse_convs_horizontally can only ever work when every fused Conv already has a bias input; it cannot actually synthesize a zero bias for a bias-less conv as the code clearly intends.
This doesn't currently crash ssd_mobilenetv1.py/ssd_resnet34.py (the only two current callers) because their convs happen to already carry a bias by the time this function runs, but the helper itself is broken for the general bias-less case it was written to handle.
Fix
Fix the off-by-one (> 2) and wrap the synthesized zero bias in a gs.Constant (appending it to the conv's inputs when it was missing) so it has the .values attribute the rest of the function relies on.
Activity