Skip to content

Commit

Permalink
Replace usage of the tsl::Status(tsl::error::Code, ...) constructor.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 517050696
Change-Id: I4834e5842acccec3356712988965c3b289bec582
  • Loading branch information
jblespiau authored and copybara-github committed Mar 16, 2023
1 parent 82ec0fe commit b31d2ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ using tensorflow::tstring;
{ \
auto s = (status); \
OP_REQUIRES(context, s.ok(), tensorflow::Status( \
static_cast<tensorflow::error::Code>(s.code()), s.message())); \
static_cast<tensorflow::errors::Code>(s.code()), s.message())); \
}

class RunLengthGammaEncodeOp : public OpKernel {
Expand Down
12 changes: 7 additions & 5 deletions tensorflow_compression/cc/kernels/run_length_kernels.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ using tensorflow::TensorShape;
using tensorflow::TensorShapeUtils;
using tensorflow::tstring;

#define OP_REQUIRES_OK_ABSL(context, status) \
{ \
auto s = (status); \
OP_REQUIRES(context, s.ok(), tensorflow::Status( \
static_cast<tensorflow::error::Code>(s.code()), s.message())); \
#define OP_REQUIRES_OK_ABSL(context, status) \
{ \
auto s = (status); \
OP_REQUIRES( \
context, s.ok(), \
tensorflow::Status(static_cast<tensorflow::errors::Code>(s.code()), \
s.message())); \
}

// TODO(jonycgn): Try to avoid in-loop branches based on attributes.
Expand Down

0 comments on commit b31d2ff

Please sign in to comment.