The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

AI::MXNet::Contrib - An interface to experimental operators defined in C++ space.

SYNOPSIS

my $embed;
if($sparse_embedding)
{
    my $embed_weight = mx->sym->Variable('embed_weight', stype=>'row_sparse');
    $embed = mx->sym->contrib->SparseEmbedding(
        data=>$data, input_dim=>$num_words,
        weight=>$embed_weight, output_dim=>$num_embed,
        name=>'embed'
    );
}
else
{
    $embed = mx->sym->Embedding(
        data=>$data, input_dim=>$num_words,
        output_dim=>$num_embed, name=>'embed'
    );
}