ai-edge-torch-nightly 0.5.0.dev20250429__py3-none-any.whl → 0.5.0.dev20250430__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ai_edge_torch/generative/layers/feed_forward_test.py +54 -0
- ai_edge_torch/version.py +1 -1
- {ai_edge_torch_nightly-0.5.0.dev20250429.dist-info → ai_edge_torch_nightly-0.5.0.dev20250430.dist-info}/METADATA +1 -1
- {ai_edge_torch_nightly-0.5.0.dev20250429.dist-info → ai_edge_torch_nightly-0.5.0.dev20250430.dist-info}/RECORD +7 -6
- {ai_edge_torch_nightly-0.5.0.dev20250429.dist-info → ai_edge_torch_nightly-0.5.0.dev20250430.dist-info}/LICENSE +0 -0
- {ai_edge_torch_nightly-0.5.0.dev20250429.dist-info → ai_edge_torch_nightly-0.5.0.dev20250430.dist-info}/WHEEL +0 -0
- {ai_edge_torch_nightly-0.5.0.dev20250429.dist-info → ai_edge_torch_nightly-0.5.0.dev20250430.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,54 @@
|
|
1
|
+
# Copyright 2025 The AI Edge Torch Authors.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
# ==============================================================================
|
15
|
+
|
16
|
+
from ai_edge_torch.generative.layers import feed_forward
|
17
|
+
import torch
|
18
|
+
import torch.nn.functional as F
|
19
|
+
from absl.testing import absltest as googletest
|
20
|
+
|
21
|
+
|
22
|
+
class FeedForwardTest(googletest.TestCase):
|
23
|
+
|
24
|
+
def test_sequential_feed_forward(self):
|
25
|
+
ff = feed_forward.SequentialFeedForward(
|
26
|
+
dim=10,
|
27
|
+
hidden_dim=10,
|
28
|
+
activation=F.silu,
|
29
|
+
use_bias=True,
|
30
|
+
use_glu=False,
|
31
|
+
pre_ff_norm=torch.nn.Identity(),
|
32
|
+
post_ff_norm=torch.nn.Identity(),
|
33
|
+
)
|
34
|
+
x = torch.ones((1, 10))
|
35
|
+
out = ff(x)
|
36
|
+
self.assertEqual(out.shape, (1, 10))
|
37
|
+
|
38
|
+
def test_gated_feed_forward(self):
|
39
|
+
ff = feed_forward.GatedFeedForward(
|
40
|
+
dim=10,
|
41
|
+
hidden_dim=10,
|
42
|
+
activation=F.silu,
|
43
|
+
use_bias=True,
|
44
|
+
use_glu=False,
|
45
|
+
pre_ff_norm=torch.nn.Identity(),
|
46
|
+
post_ff_norm=torch.nn.Identity(),
|
47
|
+
)
|
48
|
+
x = torch.ones((1, 10))
|
49
|
+
out = ff(x)
|
50
|
+
self.assertEqual(out.shape, (1, 10))
|
51
|
+
|
52
|
+
|
53
|
+
if __name__ == "__main__":
|
54
|
+
googletest.main()
|
ai_edge_torch/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: ai-edge-torch-nightly
|
3
|
-
Version: 0.5.0.
|
3
|
+
Version: 0.5.0.dev20250430
|
4
4
|
Summary: Supporting PyTorch models with the Google AI Edge TFLite runtime.
|
5
5
|
Home-page: https://github.com/google-ai-edge/ai-edge-torch
|
6
6
|
Keywords: On-Device ML,AI,Google,TFLite,PyTorch,LLMs,GenAI
|
@@ -2,7 +2,7 @@ ai_edge_torch/__init__.py,sha256=8sPR_5uXJA4NEE0nIwNdSl-ADOJEoR8hAgYvBQDY70Y,120
|
|
2
2
|
ai_edge_torch/_config.py,sha256=AiqhbcheF7j_ozIGDLC89k1we95aVgFDa-tR6h7UI0s,2529
|
3
3
|
ai_edge_torch/conftest.py,sha256=r0GTrhMRhlmOGrrkvumHN8hkmyug6WvF60vWq8wRIBI,758
|
4
4
|
ai_edge_torch/model.py,sha256=wxjSFq_rBSxSqbUE8E8EJTCkgvgaRLjq_ZuAM-IZpCU,5606
|
5
|
-
ai_edge_torch/version.py,sha256=
|
5
|
+
ai_edge_torch/version.py,sha256=NOoOWF4AVnBmA1QQLYgLUaZYRPXTIKyH1nQ0DyJXftE,706
|
6
6
|
ai_edge_torch/_convert/__init__.py,sha256=hHLluseD2R0Hh4W6XZRIXY_dRQeYudjsrKGf6LZz65g,671
|
7
7
|
ai_edge_torch/_convert/conversion.py,sha256=QVugYVfbyaeBgSKKbhFzHG5oXA7t3M-40JcpcdSu6W8,5436
|
8
8
|
ai_edge_torch/_convert/conversion_utils.py,sha256=Sr8qXVcTwc-ZnZmK7yxVrIOOp1S_vNrwzC0zUvLTI2o,2160
|
@@ -159,6 +159,7 @@ ai_edge_torch/generative/layers/attention_utils.py,sha256=zBVwlBUTs-nStIKCZG0ks5
|
|
159
159
|
ai_edge_torch/generative/layers/attention_utils_test.py,sha256=22gQ1gcRPkwqFG3_p82GZfRKVE3udEssSy58wNOqv0w,2431
|
160
160
|
ai_edge_torch/generative/layers/builder.py,sha256=LXGuSHIx6QZAzLFm7aJvlzoMPgQwbXLFchGEKYwOOUA,5090
|
161
161
|
ai_edge_torch/generative/layers/feed_forward.py,sha256=hdICat-8gW7-vxDAevJQ8NQ-mynllPiqLdXQMF6JMnc,4189
|
162
|
+
ai_edge_torch/generative/layers/feed_forward_test.py,sha256=8ZGy79BBpsyS6yKKDEKrDt249G5Mz-8VKWW7_WHx0u4,1655
|
162
163
|
ai_edge_torch/generative/layers/kv_cache.py,sha256=b-7shzDaKexmvQF7P3SiAmIz4ZofjYWv3m5u71GojsA,10460
|
163
164
|
ai_edge_torch/generative/layers/lora.py,sha256=hsvWLLOnW7HQ0AysOZu30x_cetMquDd1tjfyLz8HCSU,17892
|
164
165
|
ai_edge_torch/generative/layers/model_config.py,sha256=nLXvTkDAIHJQ0PTaWODF8oxJQoJ-K8D10cKR9229SAw,8355
|
@@ -246,8 +247,8 @@ ai_edge_torch/testing/__init__.py,sha256=_yGgvnBZWb7T3IN3mc4x1sS4vM96HZwM8pwIcPG
|
|
246
247
|
ai_edge_torch/testing/export.py,sha256=k5mGDGzwc23Z4zaIVDs8CNh-oOt64gsf9MS9NjhbPy4,3293
|
247
248
|
ai_edge_torch/testing/model_coverage/__init__.py,sha256=5P8J6Zk5YYtDvTBucFvB9NGSRI7Gw_24WnrbhXgycEE,765
|
248
249
|
ai_edge_torch/testing/model_coverage/model_coverage.py,sha256=UPB448aMDUyC0HNYVqio2rcJPnDN0tBQMP08J6vPYew,4718
|
249
|
-
ai_edge_torch_nightly-0.5.0.
|
250
|
-
ai_edge_torch_nightly-0.5.0.
|
251
|
-
ai_edge_torch_nightly-0.5.0.
|
252
|
-
ai_edge_torch_nightly-0.5.0.
|
253
|
-
ai_edge_torch_nightly-0.5.0.
|
250
|
+
ai_edge_torch_nightly-0.5.0.dev20250430.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
|
251
|
+
ai_edge_torch_nightly-0.5.0.dev20250430.dist-info/METADATA,sha256=QKdoe7QLXXeb8NfegbktiB0OuYjIbfDJjDIHPJ0B3sQ,2051
|
252
|
+
ai_edge_torch_nightly-0.5.0.dev20250430.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
253
|
+
ai_edge_torch_nightly-0.5.0.dev20250430.dist-info/top_level.txt,sha256=5KXRaF2hwkApYxf7Y8y_tVb9aulGTlbOoNdbx1aKRkE,14
|
254
|
+
ai_edge_torch_nightly-0.5.0.dev20250430.dist-info/RECORD,,
|
File without changes
|
File without changes
|