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

Function ReadVariableShapeFn

tensorflow/core/ops/resource_variable_ops.cc:32–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30namespace {
31
32Status ReadVariableShapeFn(InferenceContext* c) {
33 std::vector<ShapeAndType> shape_and_type;
34 TF_RETURN_IF_ERROR(
35 shape_inference::ValidateVariableResourceHandle(c, &shape_and_type));
36 c->set_output(0, shape_and_type[0].shape);
37 if (shape_and_type[0].dtype == DT_VARIANT && shape_and_type.size() > 1) {
38 std::vector<ShapeAndType> variant_shape_and_type;
39 std::copy(shape_and_type.begin() + 1, shape_and_type.end(),
40 std::back_inserter(variant_shape_and_type));
41 c->set_output_handle_shapes_and_types(0, variant_shape_and_type);
42 }
43 return Status::OK();
44}
45
46Status ReadVariablesShapeFn(InferenceContext* c) {
47 int n;

Callers

nothing calls this directly

Calls 7

copyFunction · 0.50
set_outputMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected