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

Function ParseScalarArgument

tensorflow/core/framework/dataset.h:951–960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

949
950template <typename T>
951Status ParseScalarArgument(OpKernelContext* ctx,
952 const StringPiece& argument_name, T* output) {
953 const Tensor* argument_t;
954 TF_RETURN_IF_ERROR(ctx->input(argument_name, &argument_t));
955 if (!TensorShapeUtils::IsScalar(argument_t->shape())) {
956 return errors::InvalidArgument(argument_name, " must be a scalar");
957 }
958 *output = argument_t->scalar<T>()();
959 return Status::OK();
960}
961
962template <typename T>
963Status ParseVectorArgument(OpKernelContext* ctx,

Callers 13

MakeDatasetMethod · 0.50
MakeDatasetMethod · 0.50
ComputeMethod · 0.50
MakeDatasetMethod · 0.50
MakeDatasetMethod · 0.50
MakeDatasetMethod · 0.50
MakeDatasetMethod · 0.50
MakeDatasetMethod · 0.50
MakeDatasetMethod · 0.50
MakeDatasetMethod · 0.50
MakeDatasetMethod · 0.50
MakeDatasetMethod · 0.50

Calls 4

InvalidArgumentFunction · 0.85
IsScalarFunction · 0.50
inputMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected