MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / DecodePng

Function DecodePng

tensorflow/go/op/wrappers.go:37656–37673  ·  view source on GitHub ↗

Decode a PNG-encoded image to a uint8 or uint16 tensor. The attr `channels` indicates the desired number of color channels for the decoded image. Accepted values are: * 0: Use the number of channels in the PNG-encoded image. * 1: output a grayscale image. * 3: output an RGB image. * 4: ou

(scope *Scope, contents tf.Output, optional ...DecodePngAttr)

Source from the content-addressed store, hash-verified

37654//
37655// Returns 3-D with shape `[height, width, channels]`.
37656func DecodePng(scope *Scope, contents tf.Output, optional ...DecodePngAttr) (image tf.Output) {
37657 if scope.Err() != nil {
37658 return
37659 }
37660 attrs := map[string]interface{}{}
37661 for _, a := range optional {
37662 a(attrs)
37663 }
37664 opspec := tf.OpSpec{
37665 Type: "DecodePng",
37666 Input: []tf.Input{
37667 contents,
37668 },
37669 Attrs: attrs,
37670 }
37671 op := scope.AddOperation(opspec)
37672 return op.Output(0)
37673}
37674
37675// AssertAttr is an optional argument to Assert.
37676type AssertAttr func(optionalAttr)

Callers 3

ComputeMethod · 0.85
ReadTensorFromImageFileFunction · 0.85
ReadTensorFromImageFileFunction · 0.85

Calls 4

aClass · 0.85
ErrMethod · 0.45
AddOperationMethod · 0.45
OutputMethod · 0.45

Tested by

no test coverage detected