tensorly.index_update

index_update(tensor, indices, values)
Updates the value of tensors in the specified indices

Should be used as:

index_update(tensor, tensorly.index[:, 3:5], values)

Equivalent of:

tensor[:, 3:5] = values
Parameters
tensortensorly.tensor

intput tensor which values to update

indicestensorly.index

indices to update

valuestensorly.tensor

values to use to fill tensor[indices]

Returns
tensor

updated tensor

See also

index