def index_put_scale(tensor, indices, value): tensor[indices] *= value return tensor