Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
composed map: add permute to kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam committed Jun 14, 2024
1 parent a52b998 commit acae6c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyop2/codegen/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ def __init__(self, *maps_):
self.offset = maps_[0].offset
self.maps_ = maps_

def indexed(self, multiindex, layer=None):
def indexed(self, multiindex, layer=None, permute=lambda x: x):
n, i, f = multiindex
n_ = n
for map_ in reversed(self.maps_):
if map_ is not self.maps_[0]:
n_, (_, _) = map_.indexed(MultiIndex(n_, FixedIndex(0), Index()), layer=None)
return self.maps_[0].indexed(MultiIndex(n_, i, f), layer=layer)
return self.maps_[0].indexed(MultiIndex(n_, i, f), layer=layer, permute=permute)


class Pack(metaclass=ABCMeta):
Expand Down

0 comments on commit acae6c5

Please sign in to comment.