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
4 changes: 3 additions & 1 deletion mindtorch/_apis/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ def select(condition, x, y):
if isinstance(y, numbers.Number) or y.ndim == 0:
y = fill_scalar(condition.shape, y, None)

return legacy.select(condition, x, y)
# return legacy.select(condition, x, y)
return add(mul(condition, x), mul(sub(1, condition), y))


def round(input, decimals):
return legacy.round(input, decimals)
Expand Down
19 changes: 17 additions & 2 deletions mindtorch/_apis/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ def sqrt(input):

__all__.append('sqrt')

def normal_float_float(mean, std, size, geneartor):
out = Tensor_(shape=size, dtype=mindtorch.float32)
def normal_float_float(mean, std, size, dtype, geneartor):
out = Tensor_(shape=size, dtype=dtype)
return mindtorch.Tensor(out)


Expand Down Expand Up @@ -371,9 +371,24 @@ def greater_equal(input, other):

__all__.append('greater_equal')

def greater(input, other):
if isinstance(input, mindtorch.Tensor):
return input
return other

def less(input, other):
if isinstance(input, mindtorch.Tensor):
return input
return other

def inplace_zero(input):
return input

def clone(input):
return input

def select(condition, input, other):
return input

def logical_not(input):
return input
2 changes: 1 addition & 1 deletion tests/test_module/custom_modeling.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from mindnlp.core import nn
from mindtorch import nn

from mindnlp.transformers import PreTrainedModel

Expand Down
Loading