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

Function Split

tensorflow/go/op/wrappers.go:3171–3194  ·  view source on GitHub ↗

Splits a tensor into `num_split` tensors along one dimension. Arguments: axis: 0-D. The dimension along which to split. Must be in the range `[-rank(value), rank(value))`. value: The tensor to split. num_split: The number of ways to split. Must evenly divide `value.shape[split_dim]`. Returns

(scope *Scope, axis tf.Output, value tf.Output, num_split int64)

Source from the content-addressed store, hash-verified

3169// except along `axis`, where their sizes are
3170// `values.shape[split_dim] / num_split`.
3171func Split(scope *Scope, axis tf.Output, value tf.Output, num_split int64) (output []tf.Output) {
3172 if scope.Err() != nil {
3173 return
3174 }
3175 attrs := map[string]interface{}{"num_split": num_split}
3176 opspec := tf.OpSpec{
3177 Type: "Split",
3178 Input: []tf.Input{
3179 axis, value,
3180 },
3181 Attrs: attrs,
3182 }
3183 op := scope.AddOperation(opspec)
3184 if scope.Err() != nil {
3185 return
3186 }
3187 var idx int
3188 var err error
3189 if output, idx, err = makeOutputList(op, idx, "output"); err != nil {
3190 scope.UpdateErr("Split", err)
3191 return
3192 }
3193 return output
3194}
3195
3196// Computes offsets of concat inputs within its output.
3197//

Callers 15

_ParseOSSURIPathMethod · 0.50
CreateDirMethod · 0.50
RecursivelyCreateDirMethod · 0.50
BatchGetMethod · 0.50
ParseGPUIdsFunction · 0.50
MainFunction · 0.50
GetMonolithicTensorKeyFunction · 0.50
ObtainTensorSliceFunction · 0.50
NodeNamePartsFromInputFunction · 0.50
DoesOpTypeMatchMethod · 0.50
TensorShapeFromStringFunction · 0.50

Calls 4

makeOutputListFunction · 0.85
UpdateErrMethod · 0.80
ErrMethod · 0.45
AddOperationMethod · 0.45

Tested by 1

CreateEndpointFunction · 0.40