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

Function TEST

tensorflow/core/ops/ctc_ops_test.cc:24–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22namespace tensorflow {
23
24TEST(CtcOpsTest, CTCLoss_ShapeFn) {
25 ShapeInferenceTestOp op("CTCLoss");
26
27 // Inputs are inputs, labels_indices, labels_values, and sequence_length.
28
29 // Rank checks
30 INFER_ERROR("must be rank 3", op, "[];?;?;?"); // inputs
31 INFER_ERROR("must be rank 2", op, "?;[];?;?"); // labels_indices
32 INFER_ERROR("must be rank 1", op, "?;?;[];?"); // labels_values
33 INFER_ERROR("must be rank 1", op, "?;?;?;[]"); // sequence_length
34
35 // labels_indices.dim(0) and labels_values.dim(0) must match.
36 INFER_ERROR("must be equal", op, "?;[1,?];[2];?");
37
38 // batch_size comes from inputs.dim(1) merged with sequence_length.dim(0).
39 // This becomes the dimension of the first out, and replaced inputs.dim(1) to
40 // become the second out.
41 INFER_OK(op, "[?,?,?];?;?;[?]", "[d0_1|d3_0];[d0_0,d0_1|d3_0,d0_2]");
42 INFER_OK(op, "[?,1,?];?;?;[1]", "[d0_1|d3_0];[d0_0,d0_1|d3_0,d0_2]");
43 INFER_OK(op, "[?,?,?];?;?;[1]", "[d3_0];[d0_0,d3_0,d0_2]");
44 INFER_OK(op, "[?,1,?];?;?;[?]", "[d0_1];[d0_0,d0_1,d0_2]");
45 INFER_ERROR("must be equal", op, "[?,1,?];?;?;[2]");
46}
47
48TEST(CtcOpsTest, CTCGreedyDecoder_ShapeFn) {
49 ShapeInferenceTestOp op("CTCGreedyDecoder");

Callers

nothing calls this directly

Calls 4

NodeDefBuilderClass · 0.85
FinalizeMethod · 0.45
AttrMethod · 0.45
InputMethod · 0.45

Tested by

no test coverage detected