Skip to content

Commit

Permalink
add examples for slicing option (apache#11918)
Browse files Browse the repository at this point in the history
  • Loading branch information
haojin2 authored and sandeep-krishnamurthy committed Aug 15, 2018
1 parent 2c3bbfc commit 80d0ce5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/operator/tensor/indexing_op.cc
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,10 @@ Examples::
indices = [[1, 1, 0], [0, 1, 0]]
gather_nd(data, indices) = [2, 3, 0]
data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
indices = [[0, 1], [1, 0]]
gather_nd(data, indices) = [[3, 4], [5, 6]]
)code")
.set_num_outputs(1)
.set_num_inputs(2)
Expand Down Expand Up @@ -629,6 +633,21 @@ Examples::
shape = (2, 2)
scatter_nd(data, indices, shape) = [[0, 0], [2, 3]]
data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]
indices = [[0, 1], [1, 1]]
shape = (2, 2, 2, 2)
scatter_nd(data, indices, shape) = [[[[0, 0],
[0, 0]],
[[1, 2],
[3, 4]]],
[[[0, 0],
[0, 0]],
[[5, 6],
[7, 8]]]]
)code")
.set_num_outputs(1)
.set_num_inputs(2)
Expand Down

0 comments on commit 80d0ce5

Please sign in to comment.