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

Method MakeDataset

tensorflow/core/kernels/data/tensor_slice_dataset_op.cc:169–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169void TensorSliceDatasetOp::MakeDataset(OpKernelContext* ctx,
170 DatasetBase** output) {
171 OpInputList inputs;
172 OP_REQUIRES_OK(ctx, ctx->input_list(kComponents, &inputs));
173 std::vector<Tensor> components;
174 components.reserve(inputs.size());
175 OP_REQUIRES(
176 ctx, inputs[0].dims() > 0,
177 errors::InvalidArgument("All components must be at least 1-dimensional"));
178 const int64 num_slices = inputs[0].dim_size(0);
179 for (const Tensor& t : inputs) {
180 components.push_back(t);
181 OP_REQUIRES(ctx, t.dims() > 0,
182 errors::InvalidArgument(
183 "All components must be at least 1-dimensional"));
184 OP_REQUIRES(
185 ctx, t.dim_size(0) == num_slices,
186 errors::InvalidArgument(
187 "All components must have the same size in the 0th dimension"));
188 }
189 *output = new Dataset(ctx, std::move(components));
190 OP_REQUIRES_OK(ctx,
191 VerifyTypesMatch((*output)->output_dtypes(), output_types_));
192 OP_REQUIRES_OK(
193 ctx, VerifyShapesCompatible((*output)->output_shapes(), output_shapes_));
194}
195
196namespace {
197REGISTER_KERNEL_BUILDER(Name("TensorSliceDataset").Device(DEVICE_CPU),

Callers

nothing calls this directly

Calls 11

InvalidArgumentFunction · 0.85
VerifyTypesMatchFunction · 0.85
VerifyShapesCompatibleFunction · 0.85
input_listMethod · 0.45
reserveMethod · 0.45
sizeMethod · 0.45
dimsMethod · 0.45
dim_sizeMethod · 0.45
push_backMethod · 0.45
output_dtypesMethod · 0.45
output_shapesMethod · 0.45

Tested by

no test coverage detected