{"record":{"id":"3e683c3a7808844b","repo":"lutzroeder/netron","slug":"expected-bias","errorCode":null,"errorMessage":"Expected 'bias'.","messagePattern":"Expected 'bias'\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"source/caffe2-proto.js","lineNumber":274,"sourceCode":"                case 11:\n                    message.axis = reader.int32();\n                    break;\n                case 12:\n                    message.is_multiparam = reader.bool();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n            }\n        }\n        if (!Object.prototype.hasOwnProperty.call(message, 'precision')) {\n            throw new Error(\"Expected 'precision'.\");\n        }\n        if (!Object.prototype.hasOwnProperty.call(message, 'scale')) {\n            throw new Error(\"Expected 'scale'.\");\n        }\n        if (!Object.prototype.hasOwnProperty.call(message, 'bias')) {\n            throw new Error(\"Expected 'bias'.\");\n        }\n        if (!Object.prototype.hasOwnProperty.call(message, 'is_signed')) {\n            throw new Error(\"Expected 'is_signed'.\");\n        }\n        return message;\n    }\n\n    static decodeText(reader) {\n        const message = new caffe2.QTensorProto();\n        reader.start();\n        while (!reader.end()) {\n            const tag = reader.tag();\n            switch (tag) {\n                case \"dims\":\n                    reader.array(message.dims, () => reader.int64());\n                    break;\n                case \"precision\":\n                    message.precision = reader.int32();","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/lutzroeder/netron/blob/d8a543f5f847ef596aa58858d6adcf5d75545f7f/source/caffe2-proto.js#L256-L292","documentation":"Generated protobuf requirement check: a binary-decoded caffe2.QTensorProto is missing the required 'bias' field. It is the third of the four mandatory QTensorProto fields (precision, scale, bias, is_signed) validated by decode().","triggerScenarios":"Decoding QTensorProto wire data where precision and scale were read but the bias field never appeared — truncated message or wrong schema version on the producer side.","commonSituations":"Corrupt/incomplete quantized model downloads; models quantized by forks with a different QTensorProto layout; stream misalignment while parsing concatenated tensors.","solutions":["Re-generate the quantized model file with a compatible toolchain","Confirm the transfer completed (checksum/size)","Inspect the payload with protoc --decode_raw for field presence","Verify the parser is reading the tensor at the correct offset in the container"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const REQUIRED = ['precision','scale','bias','is_signed'];\nconst missing = REQUIRED.filter((k) => !(k in qt));\nif (missing.length) throw new Error(`QTensorProto missing: ${missing.join(', ')}`);","typeGuard":"function isQTensor(m) {\n  return m != null && ['precision','scale','bias','is_signed']\n    .every((k) => Object.prototype.hasOwnProperty.call(m, k));\n}","tryCatchPattern":"try {\n  caffe2.QTensorProto.decode(reader);\n} catch (e) {\n  if (/^Expected '(precision|scale|bias|is_signed)'\\.$/.test(e.message)) {\n    // invalid input; skip tensor and continue with warning\n  } else throw e;\n}","preventionTips":["Validate quantized blobs with protoc --decode_raw first","Pin toolchain versions between export and load","Re-export rather than patch binary fields"],"tags":["caffe2","protobuf","qtensor","required-field"],"backgroundTag":"protobuf-missing-required-field","analyzedSha":"d8a543f5f847ef596aa58858d6adcf5d75545f7f","analyzedAt":"2026-08-27T19:21:42.082Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}