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

Function TEST_F

tensorflow/core/kernels/summary_audio_op_test.cc:78–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76};
77
78TEST_F(SummaryAudioOpTest, Basic3D) {
79 const float kSampleRate = 44100.0f;
80 const int kMaxOutputs = 3;
81 MakeOp(kMaxOutputs);
82
83 // Feed and run
84 AddInputFromArray<tstring>(TensorShape({}), {"tag"});
85 AddInputFromArray<float>(TensorShape({4, 2, 2}),
86 {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
87 0.0, 0.0, 0.0, 0.0, 0.0, 0.0});
88 AddInputFromArray<float>(TensorShape({}), {kSampleRate});
89
90 TF_ASSERT_OK(RunOpKernel());
91
92 // Check the output size.
93 Tensor* out_tensor = GetOutput(0);
94 ASSERT_EQ(0, out_tensor->dims());
95 Summary summary;
96 ParseProtoUnlimited(&summary, out_tensor->scalar<tstring>()());
97
98 CheckAndRemoveEncodedAudio(&summary);
99 EXPECT_SummaryMatches(summary, R"(
100 value { tag: 'tag/audio/0'
101 audio { content_type: "audio/wav" sample_rate: 44100 num_channels: 2
102 length_frames: 2 } }
103 value { tag: 'tag/audio/1'
104 audio { content_type: "audio/wav" sample_rate: 44100 num_channels: 2
105 length_frames: 2 } }
106 value { tag: 'tag/audio/2'
107 audio { content_type: "audio/wav" sample_rate: 44100 num_channels: 2
108 length_frames: 2 } }
109 )");
110}
111
112TEST_F(SummaryAudioOpTest, Basic2D) {
113 const float kSampleRate = 44100.0f;

Callers

nothing calls this directly

Calls 5

GetOutputFunction · 0.85
ParseProtoUnlimitedFunction · 0.85
EXPECT_SummaryMatchesFunction · 0.70
TensorShapeClass · 0.50
dimsMethod · 0.45

Tested by

no test coverage detected