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

Function Cast

tensorflow/go/op/wrappers.go:31818–31835  ·  view source on GitHub ↗

Cast x of type SrcT to y of DstT.

(scope *Scope, x tf.Output, DstT tf.DataType, optional ...CastAttr)

Source from the content-addressed store, hash-verified

31816
31817// Cast x of type SrcT to y of DstT.
31818func Cast(scope *Scope, x tf.Output, DstT tf.DataType, optional ...CastAttr) (y tf.Output) {
31819 if scope.Err() != nil {
31820 return
31821 }
31822 attrs := map[string]interface{}{"DstT": DstT}
31823 for _, a := range optional {
31824 a(attrs)
31825 }
31826 opspec := tf.OpSpec{
31827 Type: "Cast",
31828 Input: []tf.Input{
31829 x,
31830 },
31831 Attrs: attrs,
31832 }
31833 op := scope.AddOperation(opspec)
31834 return op.Output(0)
31835}
31836
31837// StatelessTruncatedNormalAttr is an optional argument to StatelessTruncatedNormal.
31838type StatelessTruncatedNormalAttr func(optionalAttr)

Callers 6

TestShapePropagationMethod · 0.50
TestExcludeNonFloatMethod · 0.50
ReadTensorFromImageFileFunction · 0.50
ReadTensorFromImageFileFunction · 0.50
WavToSpectrogramFunction · 0.50

Calls 4

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

Tested by 4

TestShapePropagationMethod · 0.40
TestExcludeNonFloatMethod · 0.40
WavToSpectrogramFunction · 0.40