Use OP_REQUIRES instead of an assertion to validate op arguments
PiperOrigin-RevId: 163841759
This commit is contained in:
parent
203c3f5fd4
commit
90abbf6849
@ -183,7 +183,7 @@ class FixedLengthRecordReaderOp : public ReaderOpKernel {
|
|||||||
errors::InvalidArgument("hop_bytes must be >= 0 not ", hop_bytes));
|
errors::InvalidArgument("hop_bytes must be >= 0 not ", hop_bytes));
|
||||||
Env* env = context->env();
|
Env* env = context->env();
|
||||||
string encoding;
|
string encoding;
|
||||||
TF_CHECK_OK(context->GetAttr("encoding", &encoding));
|
OP_REQUIRES_OK(context, context->GetAttr("encoding", &encoding));
|
||||||
SetReaderFactory([this, header_bytes, record_bytes, footer_bytes, hop_bytes,
|
SetReaderFactory([this, header_bytes, record_bytes, footer_bytes, hop_bytes,
|
||||||
encoding, env]() {
|
encoding, env]() {
|
||||||
return new FixedLengthRecordReader(name(), header_bytes, record_bytes,
|
return new FixedLengthRecordReader(name(), header_bytes, record_bytes,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user