File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
tfjs-backend-wasm/src/kernels Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 15
15
* =============================================================================
16
16
*/
17
17
18
- import { KernelConfig , KernelFunc } from '@tensorflow/tfjs-core' ;
18
+ import { KernelConfig , KernelFunc , util } from '@tensorflow/tfjs-core' ;
19
19
import { Fill , FillAttrs } from '@tensorflow/tfjs-core' ;
20
20
21
21
import { BackendWasm } from '../backend_wasm' ;
22
22
23
23
export function fill ( args : { attrs : FillAttrs , backend : BackendWasm } ) {
24
- const { attrs : { shape, value, dtype} , backend} = args ;
24
+ const { attrs : { shape, value} , backend} = args ;
25
+ let { attrs : { dtype} } = args ;
26
+
27
+ dtype = dtype || util . inferDtype ( value ) ;
28
+
25
29
const out = backend . makeOutput ( shape , dtype ) ;
26
30
const outVals = backend . typedArrayFromHeap ( out ) ;
27
31
outVals . fill ( value as number ) ;
You can’t perform that action at this time.
0 commit comments