File tree 2 files changed +15
-1
lines changed 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -715,7 +715,8 @@ module OpenBLAS =
715
715
let xl2 = Array2D.length2 x
716
716
let yl1 = Array2D.length1 y
717
717
let yl2 = Array2D.length2 y
718
- if ( xl1 <> yl1) || ( xl2 <> yl2) then
718
+ if xl1 * xl2 = 0 then ()
719
+ elif ( xl1 <> yl1) || ( xl2 <> yl2) then
719
720
ErrorMessages.InvalidArgMM()
720
721
else
721
722
Stats.InplaceOp( yl1 * yl2)
Original file line number Diff line number Diff line change @@ -24,3 +24,16 @@ let ``AD.32.R.D.FixedPoint``() =
24
24
let g ( a : D ) ( b : D ) = ( a + b / a) / ( D 2. f)
25
25
let p , t = jacobianTv' ( D.FixedPoint g ( D 1.2 f)) ( D 25. f) ( D 1. f)
26
26
Util.(= ~)( p, D 5. f) && Util.(= ~)( t, D 0.1 f)
27
+
28
+ [<Property>]
29
+ let ``Compute Adjoint`` () =
30
+ let tag = DiffSharp.Util.GlobalTagger.Next
31
+
32
+ let Wt = toDM [[ 0.0 f; 1.0 f]]
33
+ let Wt ' = Wt |> makeReverse tag
34
+ let loss ( weights : DM ) : D = cos ( weights.Item( 0 , 0 ))
35
+
36
+ let L = loss Wt'
37
+ let A = computeAdjoints L //Smoke test computeAdjoints, was an issue with single precision
38
+
39
+ ()
You can’t perform that action at this time.
0 commit comments