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

Function TopK

tensorflow/go/op/wrappers.go:18391–18408  ·  view source on GitHub ↗

Finds values and indices of the `k` largest elements for the last dimension. DEPRECATED at GraphDef version 7: Use TopKV2 instead If the input is a vector (rank-1), finds the `k` largest entries in the vector and outputs their values and indices as vectors. Thus `values[j]` is the `j`-th largest

(scope *Scope, input tf.Output, k int64, optional ...TopKAttr)

Source from the content-addressed store, hash-verified

18389//
18390// Returns The `k` largest elements along each last dimensional slice.The indices of `values` within the last dimension of `input`.
18391func TopK(scope *Scope, input tf.Output, k int64, optional ...TopKAttr) (values tf.Output, indices tf.Output) {
18392 if scope.Err() != nil {
18393 return
18394 }
18395 attrs := map[string]interface{}{"k": k}
18396 for _, a := range optional {
18397 a(attrs)
18398 }
18399 opspec := tf.OpSpec{
18400 Type: "TopK",
18401 Input: []tf.Input{
18402 input,
18403 },
18404 Attrs: attrs,
18405 }
18406 op := scope.AddOperation(opspec)
18407 return op.Output(0), op.Output(1)
18408}
18409
18410// Generate the bucket boundaries for each feature based on accumulated summaries.
18411//

Callers 2

GetTopDetectionsFunction · 0.50
GetTopLabelsFunction · 0.50

Calls 4

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

Tested by

no test coverage detected