mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-06 12:20:11 +01:00
Merge pull request #49285 from geetachavan1/cherrypicks_TH27G
Allowlist certain data types to avoid a seg fault.
This commit is contained in:
commit
4695308afc
|
|
@ -17,6 +17,8 @@ limitations under the License.
|
|||
|
||||
#include <unordered_set>
|
||||
|
||||
#include "tensorflow/core/framework/types.pb.h"
|
||||
|
||||
namespace tensorflow {
|
||||
|
||||
namespace {
|
||||
|
|
@ -86,6 +88,9 @@ ImmutableConstantOp::ImmutableConstantOp(OpKernelConstruction* context)
|
|||
OP_REQUIRES_OK(context,
|
||||
context->GetAttr(kMemoryRegionNameAttr, ®ion_name_));
|
||||
OP_REQUIRES_OK(context, context->GetAttr(kDTypeAttr, &dtype_));
|
||||
OP_REQUIRES(context, dtype_ != DT_RESOURCE && dtype_ != DT_VARIANT,
|
||||
errors::InvalidArgument(
|
||||
"Resource and variant dtypes are invalid for this op."));
|
||||
OP_REQUIRES_OK(context, context->GetAttr(kShapeAttr, &shape_));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user