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

Function GetScalar

tensorflow/core/kernels/hash_ops/training_ops.cc:491–501  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489
490template<typename T>
491Status GetScalar(
492 OpKernelContext* ctx, int id, const char* name,
493 T* result) {
494 const Tensor& tensor = ctx->input(id);
495 if (!TensorShapeUtils::IsScalar(tensor.shape())) {
496 return errors::InvalidArgument(name, " is not a scalar: ",
497 tensor.shape().DebugString());
498 }
499 *result = tensor.scalar<T>()();
500 return Status::OK();
501}
502
503template<typename T>
504T* GetData(const Tensor& tensor) {

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected