(
contents: Uint8Array, channels = 0, dtype = 'int32')
| 84 | * @doc {heading: 'Operations', subheading: 'Images', namespace: 'node'} |
| 85 | */ |
| 86 | export function decodePng( |
| 87 | contents: Uint8Array, channels = 0, dtype = 'int32'): Tensor3D { |
| 88 | util.assert( |
| 89 | dtype === 'int32', |
| 90 | () => 'decodeImage could only return Tensor of type `int32` for now.'); |
| 91 | ensureTensorflowBackend(); |
| 92 | return tidy(() => { |
| 93 | return nodeBackend().decodePng(contents, channels).toInt(); |
| 94 | }); |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Decode the first frame of a BMP-encoded image to a 3D Tensor of dtype |
no test coverage detected
searching dependent graphs…