File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from accelforge .frontend .renames import TensorName
12from collections import defaultdict
23from accelforge .frontend import arch
34from accelforge .frontend .spec import Spec
@@ -430,7 +431,10 @@ def energy(
430431 result = {}
431432 for einsum in self .einsum_names :
432433 einsum_accessed = energy .access (einsum , col_idx = 0 )
433- for tensor in self .spec .workload .einsums [einsum ].tensor_names :
434+ # None for computes
435+ for tensor in list [TensorName ](
436+ self .spec .workload .einsums [einsum ].tensor_names
437+ ) + ["None" ]:
434438 tensor_accessed = einsum_accessed .access (tensor , col_idx = 1 )
435439 for col in tensor_accessed ._get_keys_of_length (2 ):
436440 component , action = col .split ("<SEP>" )
@@ -448,7 +452,7 @@ def energy(
448452 if not keep_indices :
449453 v = sum (result .values ())
450454 if value_if_one_mapping and len (self .data ) == 1 :
451- return v .iloc [0 ]
455+ return v .iloc [0 ] if isinstance ( v , pd . Series ) else v
452456 return v
453457
454458 new_result = defaultdict (float )
You can’t perform that action at this time.
0 commit comments