Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions mindnlp/core/_dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
dtype = Type

@property
def is_floating_point(self):
def _is_floating_point(self):
return isinstance(self, (typing.Float, typing.BFloat))

@property
def is_complex(self):
def _is_complex(self):
return isinstance(self, typing.Complex)

Type.is_floating_point = is_floating_point
Type.is_complex = is_complex
Type.is_floating_point = _is_floating_point
Type.is_complex = _is_complex
Type.__str__ = Type.__repr__


Expand Down
5 changes: 4 additions & 1 deletion mindnlp/core/ops/tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ def numel(input):
def as_tensor(data, dtype=None, **kwarg):
return core.tensor(data, dtype=dtype)

__all__ = ['as_tensor', 'is_floating_point', 'is_tensor', 'numel']
def is_complex(input):
return input.dtype.is_complex

__all__ = ['as_tensor', 'is_floating_point', 'is_tensor', 'numel', 'is_complex']
Loading