Skip to content

Conversation

@matthiasdiener
Copy link
Collaborator

No description provided.

@matthiasdiener matthiasdiener self-assigned this Jun 1, 2022
# }}}


def get_num_materialized(outputs: Union[Array, DictOfNamedArrays]) \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def get_num_materialized(outputs: Union[Array, DictOfNamedArrays]) \
def get_num_materialized_predecessors(outputs: Union[Array, DictOfNamedArrays]) \


def is_materialized(expr: ArrayOrNames) -> bool:
if (isinstance(expr, Array) and
any(isinstance(tag, ImplStored) for tag in expr.tags)):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
any(isinstance(tag, ImplStored) for tag in expr.tags)):
expr.tags_of_type(ImplStored)):

# }}}


def get_num_materialized(outputs: Union[Array, DictOfNamedArrays]) \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main issue with this approach is that it has at least quadratic complexity. A possible improvement would be a CombineMapper that simply counts the materialized predecessors for each node. I.e. combine is a sum, and each node returns 1 if it's materialized and uses inherited behavior (reduce ("combine") over predecessors).

Base automatically changed from mat_stats to count-tags June 6, 2022 01:12
Base automatically changed from count-tags to main January 30, 2025 22:04
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.

3 participants