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

Function ShapeOrHandleShape

tensorflow/core/ops/training_ali_ops.cc:25–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23using shape_inference::ShapeHandle;
24
25static ShapeHandle ShapeOrHandleShape(InferenceContext* c, int input) {
26 auto* handle_data = c->input_handle_shapes_and_types(input);
27 if (handle_data != nullptr && !handle_data->empty() &&
28 (*handle_data)[0].dtype != DT_INVALID) {
29 return (*handle_data)[0].shape;
30 }
31 return c->input(input);
32}
33
34// Handle the gradient and, if <sparse>, indices inputs.
35// <s> is an input+output parameter, containing the current known input shape to

Calls 3

emptyMethod · 0.45
inputMethod · 0.45

Tested by

no test coverage detected