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

Function TEST_F

tensorflow/compiler/xla/service/dynamic_padder_test.cc:77–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75};
76
77TEST_F(DynamicPadderTest, ReduceTest) {
78 auto builder = HloComputation::Builder(TestName());
79 auto input_shape = ShapeUtil::MakeShape(F32, {1, 2, 2});
80 auto reduce_shape = ShapeUtil::MakeShape(F32, {2});
81
82 auto data_param = builder.AddInstruction(
83 HloInstruction::CreateParameter(0, input_shape, "data_param"));
84 builder.AddInstruction(
85 HloInstruction::CreateParameter(1, scalar_shape_, "size_param"));
86
87 auto negate = builder.AddInstruction(
88 HloInstruction::CreateUnary(input_shape, HloOpcode::kNegate, data_param));
89
90 auto init = builder.AddInstruction(
91 HloInstruction::CreateConstant(LiteralUtil::CreateR0<float>(0.0)));
92
93 auto reduce = builder.AddInstruction(HloInstruction::CreateReduce(
94 reduce_shape, negate, init, {0, 2}, GetScalarAddComputation()));
95
96 module_->AddEntryComputation(builder.Build());
97
98 // Set up dynamic parameter binding.
99 TF_CHECK_OK(module_->dynamic_parameter_binding().Bind(
100 DynamicParameterBinding::DynamicParameter{1, {}},
101 DynamicParameterBinding::DynamicDimension{0, {}, 1}));
102
103 TF_ASSERT_OK(RunPadder().status());
104
105 ExpectPadded(reduce->operand(0));
106}
107
108TEST_F(DynamicPadderTest, ConvolutionTest) {
109 auto builder = HloComputation::Builder(TestName());

Callers

nothing calls this directly

Calls 10

TestNameFunction · 0.85
MakeShapeFunction · 0.85
AddEntryComputationMethod · 0.80
BindMethod · 0.80
BuilderClass · 0.70
ParameterFunction · 0.70
AddInstructionMethod · 0.45
BuildMethod · 0.45
statusMethod · 0.45
operandMethod · 0.45

Tested by

no test coverage detected