File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -609,7 +609,7 @@ public function gemm(
609
609
throw new InvalidArgumentException ('"A" and "C" must have the same number of rows."B" and "C" must have the same number of columns ' );
610
610
}
611
611
} else {
612
- $ C = $ this ->zeros ($ this ->alloc ([$ M ,$ N ]));
612
+ $ C = $ this ->zeros ($ this ->alloc ([$ M ,$ N ], $ A -> dtype () ));
613
613
}
614
614
$ CC = $ C ->buffer ();
615
615
$ offC = $ C ->offset ();
@@ -1982,7 +1982,7 @@ public function onehot(
1982
1982
}
1983
1983
$ sizeX = $ X ->size ();
1984
1984
if ($ Y ===null ) {
1985
- $ Y = $ this ->zeros ($ this ->alloc ([$ sizeX ,$ numClass ]));
1985
+ $ Y = $ this ->zeros ($ this ->alloc ([$ sizeX ,$ numClass ], $ this -> defaultFloatType ));
1986
1986
}
1987
1987
if ($ Y ->ndim ()!=2 ) {
1988
1988
throw new InvalidArgumentException ('"Y" must be 2D-NDArray. ' );
Original file line number Diff line number Diff line change @@ -1204,7 +1204,7 @@ public function gemm(
1204
1204
throw new InvalidArgumentException ('"A" and "C" must have the same number of rows."B" and "C" must have the same number of columns ' );
1205
1205
}
1206
1206
} else {
1207
- $ C = $ this ->alloc ([$ M ,$ N ]);
1207
+ $ C = $ this ->alloc ([$ M ,$ N ], $ A -> dtype () );
1208
1208
$ beta = 0.0 ;
1209
1209
}
1210
1210
$ CC = $ C ->buffer ();
@@ -3160,7 +3160,7 @@ public function onehot(
3160
3160
$ addMode = true ;
3161
3161
if ($ Y ===null ) {
3162
3162
$ addMode = false ;
3163
- $ Y = $ this ->alloc ([$ sizeX ,$ numClass ]);
3163
+ $ Y = $ this ->alloc ([$ sizeX ,$ numClass ], $ this -> defaultFloatType );
3164
3164
$ waitPrev = $ waitEvents ;
3165
3165
$ waitEvents = $ this ->newEventList ();
3166
3166
$ this ->zeros ($ Y ,$ waitEvents ,$ waitPrev );
You can’t perform that action at this time.
0 commit comments