Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ivy-llc/ivy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ef20966b3208578d57ec852db0f00bb51c020b1e
Choose a base ref
..
head repository: ivy-llc/ivy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dce10a65abb1d694fb051d12057af2a3183aff33
Choose a head ref
Showing with 2 additions and 18 deletions.
  1. +2 −18 ivy/functional/frontends/torch/tensor.py
20 changes: 2 additions & 18 deletions ivy/functional/frontends/torch/tensor.py
Original file line number Diff line number Diff line change
@@ -1071,16 +1071,6 @@ def masked_fill_(self, mask, value):
self.ivy_array = self.masked_fill(mask, value).ivy_array
return self

def masked_scatter(self, mask, source):
ret = self.clone()
ret.index_put(torch_frontend.nonzero(mask, as_tuple=True), source)
return ret


def masked_scatter_(self, mask, source):
self.index_put(torch_frontend.nonzero(mask, as_tuple=True), source)
return self

@with_unsupported_dtypes({"2.2 and below": ("float16", "bfloat16")}, "torch")
def index_add_(self, dim, index, source, *, alpha=1):
self.ivy_array = torch_frontend.index_add(
@@ -2310,16 +2300,10 @@ def corrcoef(self):

def index_put(self, indices, values, accumulate=False):
ret = self.clone()
def _set_add(index):
ret[index] += values

def _set(index):
ret[index] = values

if accumulate:
ivy.map(fn=_set_add, unique={"index": indices})
ret[indices[0]] += values
else:
ivy.map(fn=_set, unique={"index": indices})
ret[indices[0]] = values
return ret

def index_put_(self, indices, values, accumulate=False):