未验证 提交 2a81d94a 编写于 作者: H huzhiqiang 提交者: GitHub

[doc] release doc and java API (#3206)

上级 f6461e39
...@@ -301,6 +301,12 @@ Tensor是Paddle-Lite的数据组织形式,用于对底层数据进行封装并 ...@@ -301,6 +301,12 @@ Tensor是Paddle-Lite的数据组织形式,用于对底层数据进行封装并
示例: 示例:
```java ```java
// 导入Java API
import com.baidu.paddle.lite.MobileConfig;
import com.baidu.paddle.lite.Tensor;
import com.baidu.paddle.lite.Predictor;
import com.baidu.paddle.lite.PowerMode;
// 设置MobileConfig // 设置MobileConfig
MobileConfig config = new MobileConfig(); MobileConfig config = new MobileConfig();
config.setModelDir(modelPath); config.setModelDir(modelPath);
...@@ -325,7 +331,7 @@ input.setData(inputBuffer); ...@@ -325,7 +331,7 @@ input.setData(inputBuffer);
predictor.run(); predictor.run();
// 获取输出Tensor // 获取输出Tensor
Tensor output = predictor.getOutput(0); Tensor result = predictor.getOutput(0);
// 获取输出数据 // 获取输出数据
float[] output = result.getFloatData(); float[] output = result.getFloatData();
for (int i = 0; i < 1000; ++i) { for (int i = 0; i < 1000; ++i) {
......
...@@ -125,7 +125,7 @@ input.setData(inputBuffer); ...@@ -125,7 +125,7 @@ input.setData(inputBuffer);
predictor.run(); predictor.run();
// 5. 获取输出数据 // 5. 获取输出数据
Tensor output = predictor.getOutput(0); Tensor result = predictor.getOutput(0);
float[] output = result.getFloatData(); float[] output = result.getFloatData();
for (int i = 0; i < 1000; ++i) { for (int i = 0; i < 1000; ++i) {
System.out.println(output[i]); System.out.println(output[i]);
......
...@@ -13,7 +13,7 @@ Paddle-Lite 提供了多种策略来自动优化原始的训练模型,其中 ...@@ -13,7 +13,7 @@ Paddle-Lite 提供了多种策略来自动优化原始的训练模型,其中
1. **推荐!** 可以进入Paddle-Lite Github仓库的[release界面](https://github.com/PaddlePaddle/Paddle-Lite/releases),选择release版本下载对应的转化工具`opt` 1. **推荐!** 可以进入Paddle-Lite Github仓库的[release界面](https://github.com/PaddlePaddle/Paddle-Lite/releases),选择release版本下载对应的转化工具`opt`
(release/v2.2.0之前的转化工具为model_optimize_tool、release/v2.3.0之后为opt) (release/v2.2.0之前的转化工具为model_optimize_tool、release/v2.3.0之后为opt)
2. 我们提供`release/v2.3`编译结果下载:[opt](https://github.com/PaddlePaddle/Paddle-Lite/releases/download/v2.3.0/opt)[opt_mac](https://github.com/PaddlePaddle/Paddle-Lite/releases/download/v2.3.0/opt_mac) 2. 我们提供`release/v2.3`编译结果下载:[opt](https://paddlelite-data.bj.bcebos.com/model_optimize_tool/opt)[opt_mac](https://paddlelite-data.bj.bcebos.com/model_optimize_tool/opt_mac)
`release/v2.2.0`版本的model_optimize_tool: [model_optimize_tool](https://paddlelite-data.bj.bcebos.com/model_optimize_tool/model_optimize_tool)[model_optimize_tool_mac](https://paddlelite-data.bj.bcebos.com/model_optimize_tool/model_optimize_tool_mac) `release/v2.2.0`版本的model_optimize_tool: [model_optimize_tool](https://paddlelite-data.bj.bcebos.com/model_optimize_tool/model_optimize_tool)[model_optimize_tool_mac](https://paddlelite-data.bj.bcebos.com/model_optimize_tool/model_optimize_tool_mac)
......
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
| 运行系统 | 下载 | | 运行系统 | 下载 |
| :---------: | :--------------: | | :---------: | :--------------: |
| Linux | [release/v2.3](https://github.com/PaddlePaddle/Paddle-Lite/releases/download/v2.3.0/opt) | | Linux | [release/v2.3](https://paddlelite-data.bj.bcebos.com/model_optimize_tool/opt) |
| MacOs | [release/v2.3](https://github.com/PaddlePaddle/Paddle-Lite/releases/download/v2.3.0/opt_mac) | | MacOs | [release/v2.3](https://paddlelite-data.bj.bcebos.com/model_optimize_tool/opt_mac) |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册