Skip to content

Commit 298d041

Browse files
Olivia-liufacebook-github-bot
authored andcommitted
Set output buffer in devtools/fb/runner for models with non-memory-planned outputs
Summary: As titled. BoltNN is using this runner to profiling and debug ET models so it's important to fix it for them. Implementation mostly copied from https://www.internalfb.com/code/fbsource/[ecdad1c2a91acadf96073ed2f3e89319b3be7593]/fbcode/executorch/extension/pybindings/pybindings.cpp?lines=138. Differential Revision: D65766614
1 parent 66dcd40 commit 298d041

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernels/quantized/cpu/op_dequantize.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,10 @@ Tensor& dequantize_per_tensor_out(
272272

273273
check_dequantize_per_tensor_args(
274274
input, quant_min, quant_max, dtype, out_dtype, out);
275-
275+
276+
if (out.mutable_data_ptr() == nullptr) {
277+
ET_CHECK_MSG(false, "out must have non-null data pointer");
278+
}
276279
// calculate the dequantized output, cast scale to float to match fbgemm
277280
// behavior
278281
#define DEQUANTIZE_IMPL(IN_CTYPE, OUT_CTYPE, out_dtype) \

0 commit comments

Comments
 (0)