Decode a JPEG-encoded image to a uint8 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 JPEG-encoded image. * 1: output a grayscale image. * 3: output an RGB image. If needed, the J
(scope *Scope, contents tf.Output, optional ...DecodeJpegAttr)
| 31174 | // |
| 31175 | // Returns 3-D with shape `[height, width, channels]`.. |
| 31176 | func DecodeJpeg(scope *Scope, contents tf.Output, optional ...DecodeJpegAttr) (image tf.Output) { |
| 31177 | if scope.Err() != nil { |
| 31178 | return |
| 31179 | } |
| 31180 | attrs := map[string]interface{}{} |
| 31181 | for _, a := range optional { |
| 31182 | a(attrs) |
| 31183 | } |
| 31184 | opspec := tf.OpSpec{ |
| 31185 | Type: "DecodeJpeg", |
| 31186 | Input: []tf.Input{ |
| 31187 | contents, |
| 31188 | }, |
| 31189 | Attrs: attrs, |
| 31190 | } |
| 31191 | op := scope.AddOperation(opspec) |
| 31192 | return op.Output(0) |
| 31193 | } |
| 31194 | |
| 31195 | // AudioSpectrogramAttr is an optional argument to AudioSpectrogram. |
| 31196 | type AudioSpectrogramAttr func(optionalAttr) |
no test coverage detected