Skip to content

Commit

Permalink
[converter] support elem logic for aten::{max,min} (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjc123 authored Dec 5, 2023
1 parent ceb2bbd commit e943b20
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tinynn/converter/operators/torch/aten.py
Original file line number Diff line number Diff line change
Expand Up @@ -3288,15 +3288,23 @@ def parse(self, node, attrs, args, graph_converter):
super().parse(node, attrs, args, graph_converter)

self.run(node)
self.handle_reduce(tfl.ReduceMinOperator, args, graph_converter, False)

if 'other' in args:
self.elementwise_binary(tfl.MinimumOperator, graph_converter, True)
else:
self.handle_reduce(tfl.ReduceMinOperator, args, graph_converter, False)


class ATenMaxOperator(ATenMaxSchema):
def parse(self, node, attrs, args, graph_converter):
super().parse(node, attrs, args, graph_converter)

self.run(node)
self.handle_reduce(tfl.ReduceMaxOperator, args, graph_converter, False)

if 'other' in args:
self.elementwise_binary(tfl.MaximumOperator, graph_converter, True)
else:
self.handle_reduce(tfl.ReduceMaxOperator, args, graph_converter, False)


class ATenAminOperator(ATenAminSchema):
Expand Down

0 comments on commit e943b20

Please sign in to comment.