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 (since PDL v2.056). 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to