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

Method Run

tensorflow/compiler/xla/tests/slice_test.cc:492–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490 public ::testing::WithParamInterface<R4Spec> {
491 protected:
492 void Run(const R4Spec& spec) {
493 Array4D<float> values(spec.input_dims[0], spec.input_dims[1],
494 spec.input_dims[2], spec.input_dims[3]);
495 values.FillIota(3.14159);
496 auto expected = ReferenceUtil::Slice4D(
497 values, spec.slice_starts, spec.slice_limits, spec.slice_strides);
498 XlaBuilder builder(TestName());
499 auto literal = LiteralUtil::CreateR4FromArray4DWithLayout(
500 values, LayoutUtil::MakeLayout(spec.input_layout));
501 auto parameter = Parameter(&builder, 0, literal.shape(), "p0");
502 TF_ASSERT_OK_AND_ASSIGN(std::unique_ptr<GlobalData> arg,
503 client_->TransferToServer(literal));
504 Slice(parameter, spec.slice_starts, spec.slice_limits, spec.slice_strides);
505 ComputeAndCompareR4(&builder, *expected, {arg.get()}, ErrorSpec(0.000001));
506 }
507};
508
509XLA_TEST_P(SliceR4Test, DoIt) { Run(GetParam()); }

Callers

nothing calls this directly

Calls 10

TestNameFunction · 0.85
FillIotaMethod · 0.80
ErrorSpecClass · 0.70
MakeLayoutFunction · 0.50
ParameterFunction · 0.50
TF_ASSERT_OK_AND_ASSIGNFunction · 0.50
SliceFunction · 0.50
shapeMethod · 0.45
TransferToServerMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected