Skip to content

[ET-VK] Generalize MeanToSumDiv to any dtype #3794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions backends/transforms/mean_to_sum_div.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

import torch
from executorch.exir.dialects._ops import ops as exir_ops

from executorch.exir.pass_base import ExportPass
Expand All @@ -19,6 +18,7 @@ def call_operator(self, op, args, kwargs, meta):
)
# args[0] is the input tensor
shape = args[0].node.meta["val"].shape
dtype = args[0].node.meta["val"].dtype
dims_to_reduce = args[1]
size = 1.0
for dim in dims_to_reduce:
Expand All @@ -32,7 +32,7 @@ def call_operator(self, op, args, kwargs, meta):
],
size,
),
{"dtype": torch.float32},
{"dtype": dtype},
meta,
)

Expand Down
Loading