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

Method ValidateInputsAreSameShape

tensorflow/core/framework/op_kernel.cc:975–988  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

973}
974
975bool OpKernelContext::ValidateInputsAreSameShape(OpKernel* op) {
976 const auto& inputs = *params_->inputs;
977 for (size_t i = 1; i < inputs.size(); ++i) {
978 if (!inputs[0]->IsSameSize(*(inputs[i].tensor))) {
979 SetStatus(errors::InvalidArgument(
980 "Inputs to operation ", op->name(), " of type ", op->type_string(),
981 " must have the same size and shape. Input 0: ",
982 inputs[0]->shape().DebugString(), " != input ", i, ": ",
983 inputs[i]->shape().DebugString()));
984 return false;
985 }
986 }
987 return true;
988}
989
990Status OpKernelContext::MatchSignature(const DataTypeSlice expected_inputs,
991 const DataTypeSlice expected_outputs) {

Callers 4

ComputeMethod · 0.45
ComputeElementwiseMethod · 0.45
ComputeMethod · 0.45
ComputeMethod · 0.45

Calls 6

InvalidArgumentFunction · 0.85
nameMethod · 0.65
sizeMethod · 0.45
IsSameSizeMethod · 0.45
DebugStringMethod · 0.45
shapeMethod · 0.45

Tested by

no test coverage detected