Skip to content

Commit 67d918f

Browse files
authored
fix: fixed typo in vectoradd Tesseract demo (#11)
#### Relevant issue or PR pasteurlabs/tesseract-core#134 fixes the jax code template #### Description of changes Fixed typos that carried over from jax code template #### Testing done Manual: Code without typos is still running #### License - [x] By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license](https://pasteurlabs.github.io/tesseract-jax/LICENSE). - [x] I sign the Developer Certificate of Origin below by adding my name and email address to the `Signed-off-by` line. <details> <summary><b>Developer Certificate of Origin</b></summary> ```text Developer Certificate of Origin Version 1.1 Copyright (C) 2004, 2006 The Linux Foundation and its contributors. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Developer's Certificate of Origin 1.1 By making a contribution to this project, I certify that: (a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or (b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. (d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. ``` </details> Signed-off-by: Heiko Zimmermann [email protected]
1 parent eaa5f33 commit 67d918f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

demo/simple/vectoradd_jax/tesseract_api.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ def apply(inputs: InputSchema) -> OutputSchema:
8686

8787
def abstract_eval(abstract_inputs):
8888
"""Calculate output shape of apply from the shape of its inputs."""
89-
is_shapedtye_dict = lambda x: type(x) is dict and (x.keys() == {"shape", "dtype"})
90-
is_shapedtye_struct = lambda x: isinstance(x, jax.ShapeDtypeStruct)
89+
is_shapedtype_dict = lambda x: type(x) is dict and (x.keys() == {"shape", "dtype"})
90+
is_shapedtype_struct = lambda x: isinstance(x, jax.ShapeDtypeStruct)
9191

9292
jaxified_inputs = jax.tree.map(
93-
lambda x: jax.ShapeDtypeStruct(**x) if is_shapedtye_dict(x) else x,
93+
lambda x: jax.ShapeDtypeStruct(**x) if is_shapedtype_dict(x) else x,
9494
abstract_inputs.model_dump(),
95-
is_leaf=is_shapedtye_dict,
95+
is_leaf=is_shapedtype_dict,
9696
)
9797
dynamic_inputs, static_inputs = eqx.partition(
98-
jaxified_inputs, filter_spec=is_shapedtye_struct
98+
jaxified_inputs, filter_spec=is_shapedtype_struct
9999
)
100100

101101
def wrapped_apply(dynamic_inputs):
@@ -105,10 +105,10 @@ def wrapped_apply(dynamic_inputs):
105105
jax_shapes = jax.eval_shape(wrapped_apply, dynamic_inputs)
106106
return jax.tree.map(
107107
lambda x: {"shape": x.shape, "dtype": str(x.dtype)}
108-
if is_shapedtye_struct(x)
108+
if is_shapedtype_struct(x)
109109
else x,
110110
jax_shapes,
111-
is_leaf=is_shapedtye_struct,
111+
is_leaf=is_shapedtype_struct,
112112
)
113113

114114

0 commit comments

Comments
 (0)