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

support ConvertibleToShape in make_distributed_recv #395

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions pytato/distributed/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
from pytools.tag import Taggable, Tag

from pytato.array import (
Array, _SuppliedShapeAndDtypeMixin, ShapeType, AxesT, _get_default_axes)
Array, _SuppliedShapeAndDtypeMixin, ShapeType, AxesT,
_get_default_axes, ConvertibleToShape, normalize_shape)

CommTagType = Hashable

Expand Down Expand Up @@ -257,13 +258,16 @@ def staple_distributed_send(sent_data: Array, dest_rank: int, comm_tag: CommTagT


def make_distributed_recv(src_rank: int, comm_tag: CommTagType,
shape: ShapeType, dtype: Any,
shape: ConvertibleToShape, dtype: Any,
axes: Optional[AxesT] = None,
tags: FrozenSet[Tag] = frozenset()
) -> DistributedRecv:
"""Make a :class:`DistributedRecv` object."""
shape = normalize_shape(shape)

if axes is None:
axes = _get_default_axes(len(shape))

dtype = np.dtype(dtype)
return DistributedRecv(src_rank, comm_tag, shape, dtype, tags=tags, axes=axes)

Expand Down