Skip to content

Commit b31d2ff

Browse files
jblespiaucopybara-github
authored andcommitted
Replace usage of the tsl::Status(tsl::error::Code, ...) constructor.
PiperOrigin-RevId: 517050696 Change-Id: I4834e5842acccec3356712988965c3b289bec582
1 parent 82ec0fe commit b31d2ff

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

tensorflow_compression/cc/kernels/run_length_gamma_kernels.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ using tensorflow::tstring;
5050
{ \
5151
auto s = (status); \
5252
OP_REQUIRES(context, s.ok(), tensorflow::Status( \
53-
static_cast<tensorflow::error::Code>(s.code()), s.message())); \
53+
static_cast<tensorflow::errors::Code>(s.code()), s.message())); \
5454
}
5555

5656
class RunLengthGammaEncodeOp : public OpKernel {

tensorflow_compression/cc/kernels/run_length_kernels.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ using tensorflow::TensorShape;
4646
using tensorflow::TensorShapeUtils;
4747
using tensorflow::tstring;
4848

49-
#define OP_REQUIRES_OK_ABSL(context, status) \
50-
{ \
51-
auto s = (status); \
52-
OP_REQUIRES(context, s.ok(), tensorflow::Status( \
53-
static_cast<tensorflow::error::Code>(s.code()), s.message())); \
49+
#define OP_REQUIRES_OK_ABSL(context, status) \
50+
{ \
51+
auto s = (status); \
52+
OP_REQUIRES( \
53+
context, s.ok(), \
54+
tensorflow::Status(static_cast<tensorflow::errors::Code>(s.code()), \
55+
s.message())); \
5456
}
5557

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

0 commit comments

Comments
 (0)