NAME

AI::MXNet::Engine - Engine properties management.

set_bulk_size

Set size limit on bulk execution.

Bulk execution bundles many operators to run together.
This can improve performance when running a lot of small
operators sequentially.

Parameters
----------
$size : int
    Maximum number of operators that can be bundled in a bulk.

Returns
-------
int
    Previous bulk size.

bulk

Bulk execution bundles many operators to run together.
This can improve performance when running a lot of small
operators sequentially.

Parameters
----------
$size : int
    Maximum number of operators that can be bundled in a bulk.
$sub: CodeRef to execute

my $x;
mx->engine->bulk(10, sub {
    $x = mx->nd->zeros([1]);
    for my $i (1..100)
    {
        $x += 1;
    }
});