You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7339 Reporter: laurent.mazare Assigned to:@gasche Status: resolved (set by @gasche on 2016-09-01T17:18:39Z) Resolution: fixed Priority: normal Severity: feature Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1 Category: otherlibs Monitored by:@yallop
Bug description
I'm wondering if there is some specific reason for not supporting the '0 dimension' case for bigarrays. This case is handled in some other numerical libraries, e.g. numpy or tensorflow, with the natural semantics of being a scalar value.
I tried relaxing the exceptions that currently prevent this case in the branch below + added some tests and it seems to work fine with a quite simple change: trunk...LaurentMazare:trunk
Note that this doesn't include any support for the bigarray.{} syntax, not sure how worthy this is.
To give some context I came along this when writing some tensorflow ocaml bindings and the current workaround is to have a wrapper around the bigarray module that handles this scalar case with a bigarray with one dimension of size one. However this isn't very neat as it requires the wrapper to store whether the embedded data is a scalar or not. It would be quite nicer to have this supported by the bigarray module directly.
Would this sound like a reasonable change ?
The text was updated successfully, but these errors were encountered:
The proposed implementation is now merged in trunk (will not be part of the feature-frozen 4.04.0, but of the next release after that, probably 4.05). Thanks!
Original bug ID: 7339
Reporter: laurent.mazare
Assigned to: @gasche
Status: resolved (set by @gasche on 2016-09-01T17:18:39Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: otherlibs
Monitored by: @yallop
Bug description
I'm wondering if there is some specific reason for not supporting the '0 dimension' case for bigarrays. This case is handled in some other numerical libraries, e.g. numpy or tensorflow, with the natural semantics of being a scalar value.
I tried relaxing the exceptions that currently prevent this case in the branch below + added some tests and it seems to work fine with a quite simple change:
trunk...LaurentMazare:trunk
Note that this doesn't include any support for the bigarray.{} syntax, not sure how worthy this is.
To give some context I came along this when writing some tensorflow ocaml bindings and the current workaround is to have a wrapper around the bigarray module that handles this scalar case with a bigarray with one dimension of size one. However this isn't very neat as it requires the wrapper to store whether the embedded data is a scalar or not. It would be quite nicer to have this supported by the bigarray module directly.
Would this sound like a reasonable change ?
The text was updated successfully, but these errors were encountered: