repeat

Repeats the output of an operation the given number of times.

A new dimension is added, allowing one to index each of these repetitions.

  1. Operation repeat(Operation input, size_t[] repetitions, string mod = __MODULE__, size_t line = __LINE__)
  2. Operation repeat(Operation input, size_t repetitions, string mod = __MODULE__, size_t line = __LINE__)
    repeat
    (
    ,,
    string mod = __MODULE__
    ,
    size_t line = __LINE__
    )

Parameters

input
Type: Operation

The operation to have its output repeated.

repetitions
Type: size_t

The number of repetitions to perform.

Return: The new Operation.

Examples

1 import dopt.core : evaluate;
2 
3 auto r1 = float32([2], [1.0f, 2.0f]).repeat(3);
4 
5 assert(r1.evaluate().as!float == [
6     1.0f, 2.0f,
7     1.0f, 2.0f,
8     1.0f, 2.0f
9 ]);

Meta