#182 add torch.ne and tensor.expand() on GPU.

Merged
zoulq merged 1 commits from frelam/MSAdapter:master20221122-2 into master 1 year ago
frelam commented 1 year ago
zoulq reviewed 1 year ago
ms_adapter/pytorch/tensor.py
@@ -430,2 +430,4 @@
input_ms = ms.ops.cast(input_ms, mstype.int32)
_size = size_to_ms_tensor(size)
# TODO: ms.ops.expand() to support on GPU and delete 'broadcast_to' code.
if get_backend() == 'GPU':
zoulq commented 1 year ago
可以直接用is_under_gpu_context
frelam commented 1 year ago
done
zoulq reviewed 1 year ago
ms_adapter/utils.py
@@ -22,2 +23,4 @@
def is_under_gpu_context():
return get_backend() == 'GPU'

@constexpr
zoulq commented 1 year ago
不需要加这个,后续会封装接口统一整改
frelam marked this conversation as resolved
zoulq merged commit 88bdcf7465 into master 1 year ago
The pull request has been merged as 88bdcf7465.
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
There is no content yet.