print('In DyGraph mode, data after run:',x.numpy())
```
In static mode, after calling layers.data, x = name: "x"
type {
type: LOD_TENSOR
lod_tensor {
tensor {
data_type: FP32
dims: -1
dims: 2
}
lod_level: 0
}
}
persistable: false
In static mode, data after run: [array([[11., 11.],
[11., 11.]], dtype=float32)]
In DyGraph mode, after calling dygraph.to_variable, x = name generated_var_0, dtype: VarType.FP32 shape: [2, 2] lod: {}
dim: 2, 2
layout: NCHW
dtype: float
data: [1 1 1 1]
In DyGraph mode, data after run: [[11. 11.]
[11. 11.]]
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py:804: UserWarning: There are no operators in the program to be executed. If you pass Program manually, please use fluid.program_guard to ensure the current Program is being used.
保存的下来的模型,同样可以使用 C++ 加载部署,具体的操作请参考:[C++ 预测 API介绍](https://www.paddlepaddle.org.cn/documentation/docs/zh/advanced_guide/inference_deployment/inference/native_infer.html)