You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2022/01/27 19:18:53 UTC

[GitHub] [incubator-mxnet] zmughal commented on a change in pull request #20852: [Perl] Updates mapping between PDL and MX types

zmughal commented on a change in pull request #20852:
URL: https://github.com/apache/incubator-mxnet/pull/20852#discussion_r793925590



##########
File path: perl-package/AI-MXNet/lib/AI/MXNet/Metric.pm
##########
@@ -79,7 +79,7 @@ use overload '""' => sub {
 has 'name'       => (is => 'rw', isa => 'Str');
 has 'num'        => (is => 'rw', isa => 'Int');
 has 'num_inst'   => (is => 'rw', isa => 'Maybe[Int|ArrayRef[Int]]');
-has 'sum_metric' => (is => 'rw', isa => 'Maybe[Num|ArrayRef[Num]]');
+has 'sum_metric' => (is => 'rw', isa => 'Maybe[Num|ArrayRef[Num]|PDL]');

Review comment:
       Yes, that is correct, they return a PDL now. This is to make sure that types such as complex numbers and BAD values can be correctly returned. To get a single Perl scalar out of a PDL, you can do `$pdl->sclr`. Though for many situations, this should work like a Perl scalar due to operator overloading.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org