Skip to content

Commit d0def8b

Browse files
Arm backend: Format docs in backends/arm/test/models
Signed-off-by: Sebastian Larsson <sebastian.larsson@arm.com> Change-Id: I655f7e88eccd3226bc27aae4a2dc1804a37f6506
1 parent f78535d commit d0def8b

11 files changed

Lines changed: 36 additions & 23 deletions

backends/arm/test/models/stable_diffusion/test_CLIPTextModelWithProjection.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030

3131

3232
class TestCLIPTextModelWithProjection:
33-
"""
34-
Test class of CLIPTextModelWithProjection.
35-
CLIPTextModelWithProjection is one of the text_encoder used by Stable Diffusion 3.5 Medium
33+
"""Test class of CLIPTextModelWithProjection.
34+
35+
CLIPTextModelWithProjection is one of the text_encoder used by Stable
36+
Diffusion 3.5 Medium
37+
3638
"""
3739

3840
# Adjust nbr below as we increase op support.

backends/arm/test/models/stable_diffusion/test_SD3Transformer2DModel.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525

2626

2727
class TestSD3Transformer2DModel:
28-
"""
29-
Test class of AutoenSD3Transformer2DModelcoderKL.
30-
SD3Transformer2DModel is the transformer model used by Stable Diffusion 3.5 Medium
28+
"""Test class of AutoenSD3Transformer2DModelcoderKL.
29+
30+
SD3Transformer2DModel is the transformer model used by Stable Diffusion 3.5
31+
Medium
32+
3133
"""
3234

3335
# Adjust nbr below as we increase op support.

backends/arm/test/models/stable_diffusion/test_T5EncoderModel.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@
2828

2929

3030
class TestT5EncoderModel:
31-
"""
32-
Test class of T5EncoderModel.
33-
T5EncoderModel is one of the text_encoder used by Stable Diffusion 3.5 Medium
31+
"""Test class of T5EncoderModel.
32+
33+
T5EncoderModel is one of the text_encoder used by Stable Diffusion 3.5
34+
Medium
35+
3436
"""
3537

3638
# Adjust nbr below as we increase op support.

backends/arm/test/models/stable_diffusion/test_vae_AutoencoderKL.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@
2828

2929

3030
class TestAutoencoderKL:
31-
"""
32-
Test class of AutoencoderKL.
31+
"""Test class of AutoencoderKL.
32+
3333
AutoencoderKL is the encoder/decoder used by Stable Diffusion 3.5 Medium
34+
3435
"""
3536

3637
def _prepare_inputs(self, batch_size=4, num_channels=3, sizes=(32, 32)):

backends/arm/test/models/test_conformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_test_inputs(dim, lengths, num_examples):
2828

2929

3030
class TestConformer:
31-
"""Tests Torchaudio Conformer"""
31+
"""Tests Torchaudio Conformer."""
3232

3333
# Adjust nbr below as we increase op support. Note: most of the delegates
3434
# calls are directly consecutive to each other in the .pte. The reason

backends/arm/test/models/test_llama.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,13 @@
4242

4343

4444
class TestLlama:
45-
"""
46-
Test class of Llama models. Type of Llama model depends on command line parameters:
45+
"""Test class of Llama models.
46+
47+
Type of Llama model depends on command line parameters:
4748
--llama_inputs <path to .pt file> <path to json file> <name of model variant>
4849
Example: --llama_inputs stories110M/stories110M.pt stories110M/params.json stories110m
4950
For more examples and info see examples/models/llama/README.md.
51+
5052
"""
5153

5254
def prepare_model(self):
@@ -101,7 +103,7 @@ def prepare_model(self):
101103

102104

103105
def _use_partial_quantizer(pipeline):
104-
"""Set the pipeline's quantizer to only include Linear layers"""
106+
"""Set the pipeline's quantizer to only include Linear layers."""
105107
pipeline.quantizer.set_global(None)
106108
pipeline.quantizer.set_module_type(
107109
torch.nn.Linear, get_symmetric_quantization_config()

backends/arm/test/models/test_lstm_arm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def test_lstm_vgf_no_quant():
143143

144144

145145
def test_lstm_tosa_INT_16a8w():
146-
"""Test LSTM model with 16A8W quantization (16-bit activations, 8-bit weights)"""
146+
"""Test LSTM 16A8W quantization (16-bit activations, 8-bit weights)."""
147147

148148
pipeline = TosaPipelineINT[input_t](
149149
TestLSTM.lstm,

backends/arm/test/models/test_mobilenet_v2_arm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242

4343
def _use_partial_quantizer(pipeline):
44-
"""Set the pipeline's quantizer to only include Conv2d and ReLU6"""
44+
"""Set the pipeline's quantizer to only include Conv2d and ReLU6."""
4545
quant_cfg = get_symmetric_quantization_config()
4646
pipeline.quantizer.set_global(None)
4747
pipeline.quantizer.set_module_type(torch.nn.Conv2d, quant_cfg)

backends/arm/test/models/test_nn_functional.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
55

6-
"""
7-
Tests 10 popular torch.nn.functional not tested in other ways or training related
6+
"""Tests 10 popular torch.nn.functional not tested in other ways or training
7+
related.
8+
89
- normalize
910
- grid_sample
1011
- one_hot
@@ -16,6 +17,7 @@
1617
- affine_grid
1718
- max_pool1d
1819
- threshold
20+
1921
"""
2022
from typing import Callable
2123

backends/arm/test/models/test_nn_modules.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# This source code is licensed under the BSD-style license found in the
44
# LICENSE file in the root directory of this source tree.
55

6-
"""
7-
Tests 10 popular nn modules not tested in other ways or training related.
6+
"""Tests 10 popular nn modules not tested in other ways or training-related.
7+
88
- Embedding
99
- LeakyReLU
1010
- BatchNorm1d
@@ -15,6 +15,7 @@
1515
- InstanceNorm2d
1616
- PReLU
1717
- Transformer
18+
1819
"""
1920

2021
from typing import Callable

0 commit comments

Comments
 (0)