Skip to content

Commit

Permalink
also remove longs indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
yueyinqiu committed Apr 29, 2024
1 parent 8da9a66 commit 22021a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ __API Changes__:

- #1266 Implicit operator from `Tensor` to `TensorIndex` has been added.
- The implicit operator from `TensorIndex` to `Tensor` has been removed.
- The indexer that accepts tensors as the indices has been removed.
- The indexers that accepts tensors/longs as the indices have been removed.

__Bug Fixes__:

Expand Down
12 changes: 0 additions & 12 deletions src/TorchSharp/Tensor/Tensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1537,18 +1537,6 @@ public Tensor this[long i1] {
}
}


/// <summary>
/// Tensor indexer.
/// </summary>
/// <param name="indices">A variable-lenght list of indices.</param>
/// <returns>A tensor, possbily singleton.</returns>
[IndexerName("TensorItems")]
public Tensor this[params long[] indices] {
get { return index(indices.Select(t => TensorIndex.Single(t)).ToArray()); }
set { index_put_(value, indices.Select(t => TensorIndex.Single(t)).ToArray()); }
}

/// <summary>
/// Index into the tensor using Python-like indexing expressions.
/// </summary>
Expand Down

0 comments on commit 22021a2

Please sign in to comment.