MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / MakeDataset

Method MakeDataset

tensorflow/core/kernels/data/interleave_dataset_op.cc:301–325  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

299}
300
301void InterleaveDatasetOp::MakeDataset(OpKernelContext* ctx, DatasetBase* input,
302 DatasetBase** output) {
303 int64 cycle_length = 0;
304 OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, kCycleLength, &cycle_length));
305 if (cycle_length == model::kAutotune) {
306 cycle_length = port::MaxParallelism();
307 }
308 OP_REQUIRES(
309 ctx, cycle_length > 0,
310 errors::InvalidArgument("cycle_length must be greater than zero."));
311
312 int64 block_length = 0;
313 OP_REQUIRES_OK(ctx, ParseScalarArgument(ctx, kBlockLength, &block_length));
314 OP_REQUIRES(
315 ctx, block_length > 0,
316 errors::InvalidArgument("block_length must be greater than zero."));
317
318 std::unique_ptr<CapturedFunction> captured_func;
319 OP_REQUIRES_OK(ctx,
320 CapturedFunction::Create(ctx, func_metadata_, kOtherArguments,
321 &captured_func));
322
323 *output = new Dataset(ctx, input, std::move(captured_func), cycle_length,
324 block_length, output_types_, output_shapes_);
325}
326
327namespace {
328REGISTER_KERNEL_BUILDER(Name("InterleaveDataset").Device(DEVICE_CPU),

Callers

nothing calls this directly

Calls 4

InvalidArgumentFunction · 0.85
ParseScalarArgumentFunction · 0.50
MaxParallelismFunction · 0.50
CreateFunction · 0.50

Tested by

no test coverage detected