Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torch array context #250

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Torch array context #250

wants to merge 7 commits into from

Conversation

inducer
Copy link
Owner

@inducer inducer commented Oct 27, 2023

kaushikcfd and others added 7 commits September 1, 2022 13:54
Passing both 'bcast_numpy_array' and '_bcast_actx_array_types' was
ill-defined. For example, in the case of an ArrayContext whose thawed
array type is np.ndarray the specification would contradict between
broadcasting the argument numpy_array to return an object array *OR*
peforming the operation with every leaf array.

Consider the example below,

(
- 'Foo: ArrayContainer' whose arithmetic routines are
   generated by `with_container_arithmetic(bcast_numpy=True,
   _bcast_actx_array_types=True)`
- 'actx: ArrayContextT' for whom `np.ndarray` is a valid thawed array
   type.
)

Foo(DOFArray(actx, [38*actx.ones(3, np.float64)])) + np.array([3, 4, 5])
could be either of:
- array([Foo(DOFArray([array([41, 41, 41])])),
         Foo(DOFArray([array([42, 42, 42])])),
         Foo(DOFArray([array([43, 43, 43])]))]), OR,
- Foo(DOFArray(actx, array([41, 42, 43])))
@inducer inducer force-pushed the numpy-rebased branch 14 times, most recently from e268bf1 to d567ad7 Compare August 6, 2024 17:50
@inducer inducer force-pushed the numpy-rebased branch 3 times, most recently from 7ac0e4e to 6251b61 Compare August 25, 2024 21:42
@inducer inducer force-pushed the numpy-rebased branch 2 times, most recently from dfc08cd to bc323fc Compare September 4, 2024 20:17
Base automatically changed from numpy-rebased to main September 4, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants