| 40 | : TypedQueue(capacity, component_dtypes, component_shapes, name) {} |
| 41 | |
| 42 | Status PriorityQueue::Initialize() { |
| 43 | Status s = TypedQueue::Initialize(); |
| 44 | if (!s.ok()) return s; |
| 45 | |
| 46 | mutex_lock lock(mu_); |
| 47 | if (component_dtypes_[0] != DT_INT64) { |
| 48 | return errors::InvalidArgument( |
| 49 | "PriorityQueue priority index component must be type int64, but " |
| 50 | "dtype is: ", |
| 51 | DataTypeString(component_dtypes_[0])); |
| 52 | } |
| 53 | if (specified_shapes() && !TensorShapeUtils::IsScalar(component_shapes_[0])) { |
| 54 | return errors::InvalidArgument( |
| 55 | "PriorityQueue priority index component must be a scalar, but shape " |
| 56 | "is: ", |
| 57 | component_shapes_[0].DebugString()); |
| 58 | } |
| 59 | return Status::OK(); |
| 60 | } |
| 61 | |
| 62 | void PriorityQueue::DequeueLocked(OpKernelContext* ctx, Tuple* tuple) { |
| 63 | DCHECK_GT(queues_[0].size(), 0); |
nothing calls this directly
no test coverage detected