Skip to content

Commit 9f3c320

Browse files
committed
Update
1 parent e1fa770 commit 9f3c320

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

docs/source/executorch_custom_versions.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
"""
88
Sphinx extension to replace ${executorch_version:TAG} with version numbers.
99
10+
It also defines a special variable ${executorch_version} that is set to the value
11+
of `EXECUTORCH_VERSION` defined in this file.
12+
1013
This custom extension pulls third-party version strings from files in the
1114
.ci/docker/ci_commit_pins directory, and uses them to expand specific strings in
1215
markdown files.
1316
14-
Users can also specify their custom version strings in the global variable `variables`
15-
1617
For example, `${executorch_version:pytorch}` will be replaced with the
1718
appropriate pytorch version string used by CI.
1819
"""
@@ -26,13 +27,11 @@
2627
"pytorch.txt",
2728
]
2829

29-
30-
variables: dict[str, str] = {
31-
"aar_version": "0.7.0",
32-
}
30+
EXECUTORCH_VERSION = "0.7.0"
3331

3432

35-
def read_version_files():
33+
def populate_version_variable():
34+
variables["${executorch_version}"] = EXECUTORCH_VERSION
3635
cwd = os.getcwd()
3736
version_file_path = os.path.join(cwd, "..", ".ci", "docker", "ci_commit_pins")
3837

@@ -43,7 +42,7 @@ def read_version_files():
4342
variables[var_name] = f.read().strip()
4443

4544

46-
read_version_files()
45+
populate_version_variable()
4746

4847

4948
def replace_variables(app, doctree, docname):

docs/source/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ To add the library to your app, add the following dependency to gradle build rul
124124
```
125125
# app/build.gradle.kts
126126
dependencies {
127-
implementation("org.pytorch:executorch-android:${executorch_version:aar_version}")
127+
implementation("org.pytorch:executorch-android:${executorch_version}")
128128
}
129129
130130
# See latest available versions in https://mvnrepository.com/artifact/org.pytorch/executorch-android

docs/source/using-executorch-android.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ The AAR library can be used for generic Android device with arm64-v8a or x86_64
2828

2929
ExecuTorch is available on [Maven Central](https://mvnrepository.com/artifact/org.pytorch/executorch-android).
3030

31-
Simply add the target [`org.pytorch:executorch-android:${executorch_version:aar_version}`](https://repo.maven.apache.org/maven2/org/pytorch/executorch-android/${executorch_version:aar_version}/) to your Android app dependency (build.gradle), and build your app.
31+
Simply add the target [`org.pytorch:executorch-android:${executorch_version}`](https://repo.maven.apache.org/maven2/org/pytorch/executorch-android/${executorch_version}/) to your Android app dependency (build.gradle), and build your app.
3232

3333
For example:
3434
```
3535
# app/build.gradle.kts
3636
dependencies {
37-
implementation("org.pytorch:executorch-android:${executorch_version:aar_version}")
37+
implementation("org.pytorch:executorch-android:${executorch_version}")
3838
}
3939
```
4040

@@ -53,7 +53,7 @@ You can also directly specify an AAR file in the app. We upload pre-built AAR to
5353

5454
| Version | AAR | SHASUMS |
5555
| ------- | --- | ------- |
56-
| [${executorch_version:aar_version}](https://github.com/pytorch/executorch/releases/tag/${executorch_version:aar_version}) | [executorch.aar](https://ossci-android.s3.amazonaws.com/executorch/release/${executorch_version:aar_version}/executorch.aar) | [executorch.aar.sha256sums](https://ossci-android.s3.amazonaws.com/executorch/release/${executorch_version:aar_version}/executorch.aar.sha256sums) |
56+
| [${executorch_version}](https://github.com/pytorch/executorch/releases/tag/${executorch_version}) | [executorch.aar](https://ossci-android.s3.amazonaws.com/executorch/release/${executorch_version}/executorch.aar) | [executorch.aar.sha256sums](https://ossci-android.s3.amazonaws.com/executorch/release/${executorch_version}/executorch.aar.sha256sums) |
5757
| [v0.6.0](https://github.com/pytorch/executorch/releases/tag/v0.6.0) | [executorch.aar](https://ossci-android.s3.amazonaws.com/executorch/release/v0.6.0/executorch.aar) | [executorch.aar.sha256sums](https://ossci-android.s3.amazonaws.com/executorch/release/v0.6.0/executorch.aar.sha256sums) |
5858
| [v0.5.0](https://github.com/pytorch/executorch/releases/tag/v0.5.0) | [executorch.aar](https://ossci-android.s3.amazonaws.com/executorch/release/v0.5.0-rc3/executorch.aar) | [executorch.aar.sha256sums](https://ossci-android.s3.amazonaws.com/executorch/release/v0.5.0-rc3/executorch.aar.sha256sums) |
5959

@@ -91,7 +91,7 @@ implementation("com.facebook.fbjni:fbjni:0.5.1")
9191
In your app working directory, such as executorch/examples/demo-apps/android/LlamaDemo,
9292
```
9393
mkdir -p app/libs
94-
curl https://ossci-android.s3.amazonaws.com/executorch/release/${executorch_version:aar_version}/executorch.aar -o app/libs/executorch.aar
94+
curl https://ossci-android.s3.amazonaws.com/executorch/release/${executorch_version}/executorch.aar -o app/libs/executorch.aar
9595
```
9696

9797
And include it in gradle:

0 commit comments

Comments
 (0)