[graphics] Fix for canonicalizeHighlights#34
Open
gilbertmike wants to merge 1 commit intoFibertree-Project:masterfrom
Open
[graphics] Fix for canonicalizeHighlights#34gilbertmike wants to merge 1 commit intoFibertree-Project:masterfrom
gilbertmike wants to merge 1 commit intoFibertree-Project:masterfrom
Conversation
Collaborator
|
Hi Michael, K = 4
M = 5
density = [0.9, 0.5]
seed = 0
A_KM = Tensor.fromRandom(rank_ids=["K", "M"], shape=[K, M], seed=seed, density=density, name="A")
B_KM = Tensor.fromRandom(rank_ids=["K", "M"], shape=[K, M], seed=seed + 1, density=density, name="B")
A_KM_flat = A_KM.flattenRanks(depth=0, levels=1, coord_style="tuple")
A_KM_flat.setRankIds(rank_ids=["KM"])
B_KM_flat = B_KM.flattenRanks(depth=0, levels=1, coord_style="tuple")
B_KM_flat.setRankIds(rank_ids=["KM"])
Z_KM_flat = Tensor(rank_ids=["KM"], name="Z")
a_km = A_KM_flat.getRoot()
b_km = B_KM_flat.getRoot()
z_km = Z_KM_flat.getRoot()
canvas = createCanvas(A_KM_flat, B_KM_flat, Z_KM_flat)
for (k, m), (z_ref, (a_val, b_val)) in z_km << (a_km & b_km):
z_ref <<= a_val * b_val
canvas.addActivity(((k, m),), ((k, m),), ((k, m),))
Z_KM = Z_KM_flat.unflattenRanks(depth=0, levels=1)
Z_KM.setRankIds(rank_ids=["K", "M"])
displayCanvas(canvas)I do not want to break the ability to display flattened ranks because they are used heavily by the accelerator zoo (see https://github.com/FPSG-UIUC/accelerator-zoo). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The method
canonicalizeHighlightsseems to add an extraneous level of list nesting, causing errors.Previously:
With the change, both works and the different formats follow the correct code path.