-
Notifications
You must be signed in to change notification settings - Fork 229
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
compiler: Expose Bundle's properties correctly #2487
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -368,6 +368,8 @@ def __args_setup__(cls, *args, **kwargs): | |
raise ValueError("Component type must be subclass of AbstractFunction") | ||
if len({i.__padding_dtype__ for i in components}) != 1: | ||
raise ValueError("Components must have the same padding dtype") | ||
if len({i.properties for i in components}) != 1: | ||
raise ValueError("Components must have the same properties") | ||
|
||
return args, kwargs | ||
|
||
|
@@ -441,12 +443,13 @@ def initvalue(self): | |
|
||
# Overrides defaulting to self.c0's behaviour | ||
|
||
for i in ['_mem_internal_eager', '_mem_internal_lazy', '_mem_local', | ||
for i in ('_mem_internal_eager', '_mem_internal_lazy', '_mem_local', | ||
'_mem_mapped', '_mem_host', '_mem_stack', '_mem_constant', | ||
'_mem_shared', '__padding_dtype__', '_size_domain', '_size_halo', | ||
'_size_owned', '_size_padding', '_size_nopad', '_size_nodomain', | ||
'_offset_domain', '_offset_halo', '_offset_owned', '_dist_dimensions', | ||
'_C_get_field', 'grid', 'symbolic_shape']: | ||
'_C_get_field', 'grid', 'symbolic_shape', | ||
*AbstractFunction.__properties__): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpick: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
locals()[i] = property(lambda self, v=i: getattr(self.c0, v)) | ||
|
||
@property | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks more like "counting" rather than "comparing", should you say, the same number of properties?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not counting properties it's check the set length one, i.e all properties are the same