-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Labels
Description
In the current spec, MLGraphBuilder.constant(value, type) allows to build a scalar from the specified number, e.g.,
const a = graphBuilder.constant(42.0, 'float32');However, MLGraphBuilder.constant(descriptor, bufferView) also allows to build a scalar from data buffer, like the example in #390
const b = graphBuilder.constant({type: 'float32'}, new Float32Array([42.0]));The proposal is to drop the scalar-specific MLGraphBuilder.constant(value, type) method and only keep more generic MLGraphBuilder.constant(descriptor, bufferView) method.
The scalar-specific build method can be polyfilled by user code. This would help reduce the browser implementation complexity.
/cc @wchao1115 @fdwr @wacky6 @BruceDai @Honry
(Edit by @anssiko: fix link and naming to account for name changes dataType -> type and buffer -> bufferView)
Reactions are currently unavailable