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

Function TEST

tensorflow/core/ops/string_ops_test.cc:25–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23namespace tensorflow {
24
25TEST(StringOpsTest, StringJoin_ShapeFn) {
26 ShapeInferenceTestOp op("StringJoin");
27 int n = 3;
28 std::vector<NodeDefBuilder::NodeOut> src_list;
29 src_list.reserve(n);
30 for (int i = 0; i < n; ++i) src_list.emplace_back("a", 0, DT_STRING);
31 TF_ASSERT_OK(NodeDefBuilder("test", "StringJoin")
32 .Input(src_list)
33 .Attr("n", n)
34 .Finalize(&op.node_def));
35
36 // If all inputs are scalar, return a scalar.
37 INFER_OK(op, "[];[];[]", "[]");
38
39 // If one input is unknown, but rest scalar, return unknown. Technically this
40 // could return in1, but we don't optimize this case yet.
41 INFER_OK(op, "[];?;[]", "?");
42
43 // Inputs that are non-scalar are merged to produce the output.
44 INFER_OK(op, "[1,?];[];[?,2]", "[d0_0,d2_1]");
45 INFER_OK(op, "[1,?];?;[?,2]", "[d0_0,d2_1]");
46 INFER_ERROR("must be equal", op, "[1,2];[];[?,3]");
47}
48
49} // end namespace tensorflow

Callers

nothing calls this directly

Calls 6

NodeDefBuilderClass · 0.85
reserveMethod · 0.45
emplace_backMethod · 0.45
FinalizeMethod · 0.45
AttrMethod · 0.45
InputMethod · 0.45

Tested by

no test coverage detected