Skip to content

Commit

Permalink
fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zkh2016 committed Apr 14, 2022
1 parent 83a12d6 commit 0768215
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/paddle/sparse/layer/conv.py
Expand Up @@ -210,6 +210,8 @@ class Conv3D(_Conv3D):
with _test_eager_guard():
indices = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 2], [1, 3, 2, 3]]
values = [[1], [2], [3], [4]]
indices = paddle.to_tensor(indices, dtype='int32')
values = paddle.to_tensor(values, dtype='float32')
dense_shape = [1, 1, 3, 4, 1]
sparse_x = paddle.sparse.sparse_coo_tensor(indices, values, dense_shape, stop_gradient=True)
conv = paddle.sparse.Conv3D(1, 1, (1, 3, 3))
Expand Down Expand Up @@ -342,6 +344,8 @@ class SubmConv3D(_Conv3D):
indices = [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 2], [1, 3, 2, 3]]
values = [[1], [2], [3], [4]]
dense_shape = [1, 1, 3, 4, 1]
indices = paddle.to_tensor(indices, dtype='int32')
values = paddle.to_tensor(values, dtype='float32')
sparse_x = paddle.sparse.sparse_coo_tensor(indices, values, dense_shape, stop_gradient=True)
subm_conv = paddle.sparse.SubmConv3D(1, 1, (1, 3, 3))
y = subm_conv(sparse_x)
Expand Down

1 comment on commit 0768215

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.