Skip to content
Snippets Groups Projects
Unverified Commit 3325eaf9 authored by Luyang's avatar Luyang Committed by GitHub
Browse files

Fix logical slice assign dtype (#5339)


* refine and add test case

* support ellipsis type slice

* refine

* refine

* support slice assign ellipsis type

* refine

* register fn to localtensor

* make sure input's dtype == update's dtype

Co-authored-by: default avataroneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
parent 6a7b561b
No related branches found
No related tags found
No related merge requests found
......@@ -116,6 +116,8 @@ class LogicalSliceAssign(Module):
self.step = step
def forward(self, x, update):
if update.dtype != x.dtype:
update = update.to(dtype=x.dtype)
return flow.F.logical_slice_assign(
x, update, start=self.start, stop=self.stop, step=self.step
)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment