Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Fix to make the code compile with newer version of tensorflow #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sbnet_tensorflow/benchmark/tf_conv_dims_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_calc_padding_err_ksize_list(self):
try:
calc_padding_4d(tf.shape(x), [2, 3, 1, 1, 1], [2, 1, 1, 1], 'SAME')
except AssertionError as e:
self.assertEqual(e.message, 'Expect `ksize` a list/tuple of length 4.')
self.assertEqual(e.args[0], 'Expect `ksize` a list/tuple of length 4.')
err_raised = True
self.assertTrue(err_raised)

Expand All @@ -98,7 +98,7 @@ def test_calc_padding_err_strides_list(self):
try:
calc_padding_4d(tf.shape(x), [2, 3, 1, 1], [2, 1, 1, 1], 'SAME')
except AssertionError as e:
self.assertEqual(e.message, 'Expect first and last dimension of `strides` = 1.')
self.assertEqual(e.args[0], 'Expect first and last dimension of `strides` = 1.')
err_raised = True
self.assertTrue(err_raised)

Expand Down
4 changes: 2 additions & 2 deletions sbnet_tensorflow/sbnet_ops/sparse_gather.cc
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ template <typename Device, typename T> class SparseGatherOp : public OpKernel {
OP_REQUIRES_OK(context, context->GetAttr("boffset", &boffset));
OP_REQUIRES(context,
bsize.size() == 2 && bstride.size() == 2 && boffset.size() == 2,
errors::InvalidArgument("All block attributes must have a shape of (2,)."))
errors::InvalidArgument("All block attributes must have a shape of (2,)."));
OP_REQUIRES_OK(context, context->GetAttr("transpose", &transpose_));

bSzH_ = bsize[0]; bSzW_ = bsize[1];
Expand Down Expand Up @@ -278,7 +278,7 @@ template <typename Device, typename T, bool UseVar> class SparseScatterOp : publ
OP_REQUIRES_OK(context, context->GetAttr("boffset", &boffset));
OP_REQUIRES(context,
bsize.size() == 2 && bstride.size() == 2 && boffset.size() == 2,
errors::InvalidArgument("All block attributes must have a shape of (2,)."))
errors::InvalidArgument("All block attributes must have a shape of (2,)."));
bSzH_ = bsize[0]; bSzW_ = bsize[1];
bStrH_ = bstride[0]; bStrW_ = bstride[1];
bOffsH0_ = boffset[0]; bOffsW0_ = boffset[1];
Expand Down