MXNetSharp
MXNetSharp copied to clipboard
Pow operator inference problems
let nd = CPU(0).CopyFrom([|0.0 .. 10.0|])
let a = 2.0 + (2.0 ** nd)
let b = (2.0 ** nd) + 2.0
Both a
and b
fail overload resolution
error FS0071: Type constraint mismatch when applying the default type 'obj' for a type inference variable. No overloads match for method 'op_DynamicAssignment'. The available overloads are shown below. Consider adding further type constraints
Possible overload: 'static member InternalPrimitiveOperatorHelpers.PowerOp.( ?<- ) : PowerOp:InternalPrimitiveOperatorHelpers.PowerOp * Dummy1:InternalPrimitiveOperatorHelpers.Dummy1 * a: ^a0 -> ( ^a1 -> ^a0) when ^a0 : (static member Pow : ^a0 * ^a1 -> ^a0)'. Type constraint mismatch. The type
'obj'
is not compatible with type
'InternalPrimitiveOperatorHelpers.Dummy1'
.
Possible overload: 'static member InternalPrimitiveOperatorHelpers.PowerOp.( ?<- ) : PowerOp:InternalPrimitiveOperatorHelpers.PowerOp * Dummy2:InternalPrimitiveOperatorHelpers.Dummy2 * a: ^t -> ( ^y -> ^s) when ( ^t or ^y) : (static member ApplyPow : ^t * ^y -> ^s)'. Type constraint mismatch. The type
'obj'
is not compatible with type
'InternalPrimitiveOperatorHelpers.Dummy2'
Best solution define a new operator and not use (**)