Use OP_REQUIRES instead of an assertion to validate op arguments

PiperOrigin-RevId: 163841759
This commit is contained in:
Benoit Steiner 2017-08-01 09:38:39 -07:00 committed by TensorFlower Gardener
parent 203c3f5fd4
commit 90abbf6849

View File

@ -183,7 +183,7 @@ class FixedLengthRecordReaderOp : public ReaderOpKernel {
errors::InvalidArgument("hop_bytes must be >= 0 not ", hop_bytes));
Env* env = context->env();
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,
encoding, env]() {
return new FixedLengthRecordReader(name(), header_bytes, record_bytes,