void MakeDataset()

in src/pipemode_op/Dataset/src/pipemode_dataset_op_kernel.cpp [85:112]


    void MakeDataset(OpKernelContext* ctx, DatasetBase** output) override {
        std::string record_format;
        std::string state_directory;
        std::string channel_directory;
        std::string channel;
        bool benchmark;
        std::uint64_t benchmark_records_interval;
        std::uint32_t max_corrupted_records_to_skip;
        OP_REQUIRES_OK(ctx, tensorflow::data::ParseScalarArgument<std::string>(ctx, "record_format",
                                                        &record_format));
        OP_REQUIRES_OK(ctx, tensorflow::data::ParseScalarArgument<std::string>(ctx, "state_directory",
                                                        &state_directory));
        OP_REQUIRES_OK(ctx, tensorflow::data::ParseScalarArgument<std::string>(ctx, "channel_directory",
                                                        &channel_directory));
        OP_REQUIRES_OK(ctx, tensorflow::data::ParseScalarArgument<std::string>(ctx, "channel",
                                                        &channel));
        OP_REQUIRES(ctx, record_format == "RecordIO" || record_format == "TFRecord" || record_format == "TextLine",
            tensorflow::errors::InvalidArgument("Invalid record format: " + record_format));
        OP_REQUIRES_OK(ctx, tensorflow::data::ParseScalarArgument<bool>(ctx, "benchmark",
                                                        &benchmark));
        OP_REQUIRES_OK(ctx, tensorflow::data::ParseScalarArgument<std::uint64_t>(ctx, "benchmark_records_interval",
                                                        &benchmark_records_interval));
        OP_REQUIRES_OK(ctx, tensorflow::data::ParseScalarArgument<std::uint32_t>(ctx, "max_corrupted_records_to_skip",
                                                        &max_corrupted_records_to_skip));

        *output = new Dataset(ctx, record_format, state_directory, channel_directory, channel, benchmark,
                              benchmark_records_interval, max_corrupted_records_to_skip);
    }