Home | History | Annotate | Download | only in service

Lines Matching refs:Tuple

268   // Test that DeepCopyInstruction properly copies a tuple.
274 auto tuple = builder.AddInstruction(
279 auto tuple_copy = computation->DeepCopyInstruction(tuple).ValueOrDie();
281 EXPECT_THAT(tuple_copy, op::Tuple(op::Copy(op::GetTupleElement(tuple)),
282 op::Copy(op::GetTupleElement(tuple))));
313 // Test that DeepCopyInstruction properly copies elements of a tuple as
320 auto tuple = builder.AddInstruction(
326 ShapeTree<bool> indices_to_copy(tuple->shape(), /*init_value=*/true);
327 ShapeTree<HloInstruction*> copies_added(tuple->shape(),
330 computation->DeepCopyInstruction(tuple, &indices_to_copy, &copies_added)
333 EXPECT_THAT(deep_copy, op::Tuple(op::Copy(op::GetTupleElement(tuple)),
334 op::Copy(op::GetTupleElement(tuple))));
335 EXPECT_THAT(deep_copy, op::Tuple(copies_added.element({0}),
340 // All false elements should copy no array elements, but the GTE and tuple
342 ShapeTree<bool> indices_to_copy(tuple->shape(), /*init_value=*/false);
343 ShapeTree<HloInstruction*> copies_added(tuple->shape(),
346 computation->DeepCopyInstruction(tuple, &indices_to_copy, &copies_added)
349 EXPECT_THAT(deep_copy, op::Tuple(op::GetTupleElement(tuple),
350 op::GetTupleElement(tuple)));
358 ShapeTree<bool> indices_to_copy(tuple->shape(), /*init_value=*/false);
360 ShapeTree<HloInstruction*> copies_added(tuple->shape(),
363 computation->DeepCopyInstruction(tuple, &indices_to_copy, &copies_added)
366 EXPECT_THAT(deep_copy, op::Tuple(op::Copy(op::GetTupleElement(tuple)),
367 op::GetTupleElement(tuple)));