Skip to content

Conversation

@justinchuby
Copy link

@justinchuby justinchuby commented Dec 25, 2025

This pull request corrects the type of the shape parameter in Builder.placeholder.

@justinchuby justinchuby marked this pull request as ready for review December 31, 2025 17:44
@TobyRoseman
Copy link
Collaborator

Tuple seems like the better choice here to me. Why do you think it should be a Sequence?

@justinchuby
Copy link
Author

From

if not isinstance(sym_shape, (list, tuple, _np.ndarray)):
raise ValueError("Illegal shape for Placeholder: {}".format(sym_shape))
it looks like shape needs to be list, tuple, _np.ndarray. Maybe setting to a union of these is appropriate then?

If we stick to tuples, it needs to be Tuple[Any, ...] to correctly accept a shape. Currently it only accepts 1-element tuples.

@TobyRoseman
Copy link
Collaborator

I agree it should be Tuple[Any, ...] not Tuple[Any]. I probably wouldn't worry about adding a Union.

@justinchuby
Copy link
Author

Done

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