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

Function Bitcast

tensorflow/go/op/wrappers.go:22718–22732  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

22716// *NOTE*: Bitcast is implemented as a low-level cast, so machines with different
22717// endian orderings will give different results.
22718func 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.
22735func TensorSliceDataset(scope *Scope, components []tf.Output, output_shapes []tf.Shape) (handle tf.Output) {

Callers 9

HandleBitcastMethod · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_PFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85
TEST_FFunction · 0.85

Calls 3

ErrMethod · 0.45
AddOperationMethod · 0.45
OutputMethod · 0.45

Tested by 8

TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_PFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68
TEST_FFunction · 0.68