diff --git a/docs/how-to-use-and-FAQ/FAQ-ncnn-produce-wrong-result.md b/docs/how-to-use-and-FAQ/FAQ-ncnn-produce-wrong-result.md index f4cf49399..e649d90bf 100644 --- a/docs/how-to-use-and-FAQ/FAQ-ncnn-produce-wrong-result.md +++ b/docs/how-to-use-and-FAQ/FAQ-ncnn-produce-wrong-result.md @@ -185,4 +185,13 @@ ncnn::Net net; net.opt.use_fp16_packed = false; net.opt.use_fp16_storage = false; net.opt.use_fp16_arithmetic = false; -``` \ No newline at end of file +``` + +### make data contiguous +If you find the output of pnnx.py and ncnn.py (generated by pnnx) is different, This may be due to data discontiguous. You can set the ncnn.py as follows and moditfity other codes: +``` python +def test_inference(): + torch.manual_seed(0) + in0 = torch.rand(1, 3, 224, 224, dtype=torch.float) + in0.contiguous() +```