#include <nn_ops.h>
Optional attribute setters for ApproxTopK.
| Public attributes | |
|---|---|
aggregate_to_topk_ = true | bool |
is_max_k_ = true | bool |
recall_target_ = 0.95f | float |
reduction_dimension_ = -1 | int64 |
reduction_input_size_override_ = -1 | int64 |
| Public functions | |
|---|---|
AggregateToTopk(bool x) | TF_MUST_USE_RESULT Attrs When true, aggregates approximate results to top-k. |
IsMaxK(bool x) | TF_MUST_USE_RESULT Attrs When true, computes max-k; otherwise computes min-k. |
RecallTarget(float x) | TF_MUST_USE_RESULT Attrs Recall target for the approximation. |
ReductionDimension(int64 x) | TF_MUST_USE_RESULT Attrs Integer dimension along which to search. |
ReductionInputSizeOverride(int64 x) | TF_MUST_USE_RESULT Attrs When set to a positive value, it overrides the size determined by input[reduction_dim] for evaluating the recall. |
bool tensorflow::ops::ApproxTopK::Attrs::aggregate_to_topk_ = true
bool tensorflow::ops::ApproxTopK::Attrs::is_max_k_ = true
float tensorflow::ops::ApproxTopK::Attrs::recall_target_ = 0.95f
int64 tensorflow::ops::ApproxTopK::Attrs::reduction_dimension_ = -1
int64 tensorflow::ops::ApproxTopK::Attrs::reduction_input_size_override_ = -1
TF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::AggregateToTopk( bool x )
When true, aggregates approximate results to top-k.
When false, returns the approximate results. The number of the approximate results is implementation defined and is greater equals to the specified k.
Defaults to true
TF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::IsMaxK( bool x )
When true, computes max-k; otherwise computes min-k.
Defaults to true
TF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::RecallTarget( float x )
TF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::ReductionDimension( int64 x )
Integer dimension along which to search.
Default: -1.
Defaults to -1
TF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::ReductionInputSizeOverride( int64 x )
When set to a positive value, it overrides the size determined by input[reduction_dim] for evaluating the recall.
This option is useful when the given input is only a subset of the overall computation in SPMD or distributed pipelines, where the true input size cannot be deferred by the input shape.
Defaults to -1
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/struct/tensorflow/ops/approx-top-k/attrs