Bitcasts a tensor from one type to another without copying data. Given a tensor `input`, this operation returns a tensor that has the same buffer data as `input` with datatype `type`. If the input datatype `T` is larger than the output datatype `type` then the shape changes from [...] to [..., siz
(scope *Scope, input tf.Output, type_ tf.DataType)
| 22716 | // *NOTE*: Bitcast is implemented as a low-level cast, so machines with different |
| 22717 | // endian orderings will give different results. |
| 22718 | func Bitcast(scope *Scope, input tf.Output, type_ tf.DataType) (output tf.Output) { |
| 22719 | if scope.Err() != nil { |
| 22720 | return |
| 22721 | } |
| 22722 | attrs := map[string]interface{}{"type": type_} |
| 22723 | opspec := tf.OpSpec{ |
| 22724 | Type: "Bitcast", |
| 22725 | Input: []tf.Input{ |
| 22726 | input, |
| 22727 | }, |
| 22728 | Attrs: attrs, |
| 22729 | } |
| 22730 | op := scope.AddOperation(opspec) |
| 22731 | return op.Output(0) |
| 22732 | } |
| 22733 | |
| 22734 | // Creates a dataset that emits each dim-0 slice of `components` once. |
| 22735 | func TensorSliceDataset(scope *Scope, components []tf.Output, output_shapes []tf.Shape) (handle tf.Output) { |