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

Method MakeShape

tensorflow/core/framework/op_kernel.cc:163–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161}
162
163Status OpKernel::MakeShape(const Tensor& shape, TensorShape* out) const {
164 if (!IsLegacyVector(shape.shape())) {
165 return errors::InvalidArgument(
166 "shape must be a vector of {int32,int64}, got shape ",
167 shape.shape().DebugString());
168 }
169 if (shape.dtype() == DataType::DT_INT32) {
170 auto vec = shape.flat<int32>();
171 return TensorShapeUtils::MakeShape(vec.data(), vec.size(), out);
172 } else if (shape.dtype() == DataType::DT_INT64) {
173 auto vec = shape.flat<int64>();
174 return TensorShapeUtils::MakeShape(vec.data(), vec.size(), out);
175 } else {
176 return errors::InvalidArgument("shape must be a vector of {int32,int64}.");
177 }
178}
179
180void AsyncOpKernel::Compute(OpKernelContext* context) {
181 Notification n;

Callers 15

string_ops.ccFile · 0.45
DecodeWavShapeFnFunction · 0.45
SpectrogramShapeFnFunction · 0.45
MfccShapeFnFunction · 0.45
rnn_ops.ccFile · 0.45
data_flow_ops.ccFile · 0.45
FractionalPoolShapeFnFunction · 0.45
nn_ops.ccFile · 0.45

Calls 7

InvalidArgumentFunction · 0.85
MakeShapeFunction · 0.85
shapeMethod · 0.45
DebugStringMethod · 0.45
dtypeMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by 4

MakeShapeFromStringMethod · 0.36
TESTFunction · 0.36
TEST_FFunction · 0.36
TEST_FFunction · 0.36