Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::ApproxTopK::Attrs
#include <nn_ops.h>
Optional attribute setters for ApproxTopK.
Summary
Public functions
|
AggregateToTopk(bool x)
|
When true, aggregates approximate results to top-k.
|
IsMaxK(bool x)
|
When true, computes max-k; otherwise computes min-k.
|
RecallTarget(float x)
|
Recall target for the approximation.
|
ReductionDimension(int64 x)
|
Integer dimension along which to search.
|
ReductionInputSizeOverride(int64 x)
|
When set to a positive value, it overrides the size determined by input[reduction_dim] for evaluating the recall.
|
Public attributes
aggregate_to_topk_
bool tensorflow::ops::ApproxTopK::Attrs::aggregate_to_topk_ = true
is_max_k_
bool tensorflow::ops::ApproxTopK::Attrs::is_max_k_ = true
recall_target_
float tensorflow::ops::ApproxTopK::Attrs::recall_target_ = 0.95f
reduction_dimension_
int64 tensorflow::ops::ApproxTopK::Attrs::reduction_dimension_ = -1
int64 tensorflow::ops::ApproxTopK::Attrs::reduction_input_size_override_ = -1
Public functions
AggregateToTopk
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
IsMaxK
TF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::IsMaxK(
bool x
)
When true, computes max-k; otherwise computes min-k.
Defaults to true
RecallTarget
TF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::RecallTarget(
float x
)
Recall target for the approximation.
Range in (0,1]
Defaults to 0.95
ReductionDimension
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
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2022-09-07 UTC.
[null,null,["Last updated 2022-09-07 UTC."],[],[],null,["# tensorflow::ops::ApproxTopK::Attrs Struct Reference\n\ntensorflow::ops::ApproxTopK::Attrs\n==================================\n\n`#include \u003cnn_ops.h\u003e`\n\nOptional attribute setters for [ApproxTopK](/api_docs/cc/class/tensorflow/ops/approx-top-k#classtensorflow_1_1ops_1_1_approx_top_k).\n\nSummary\n-------\n\n| ### Public attributes ||\n|---------------------------------------------------------------------------------------------------------------------------------|---------|\n| [aggregate_to_topk_](#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs_1a2e12712b3f25d850fa545035febe1395)` = true` | `bool` |\n| [is_max_k_](#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs_1a786a9dde050fc5167c170a5f27f070b1)` = true` | `bool` |\n| [recall_target_](#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs_1a43167ac64091dad1ae850837f9420090)` = 0.95f` | `float` |\n| [reduction_dimension_](#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs_1abb2309a16e6565239360c9e81b77ad72)` = -1` | `int64` |\n| [reduction_input_size_override_](#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs_1ae0ecb7914b78269d39ce58be39810407)` = -1` | `int64` |\n\n| ### Public functions ||\n|---------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [AggregateToTopk](#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs_1a20a04cd935e0060ecc9541f336a23628)`(bool x)` | `TF_MUST_USE_RESULT `[Attrs](/api_docs/cc/struct/tensorflow/ops/approx-top-k/attrs#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs) When true, aggregates approximate results to top-k. |\n| [IsMaxK](#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs_1ae8b4c952bb9e1f8f94aec45e4d6a4192)`(bool x)` | `TF_MUST_USE_RESULT `[Attrs](/api_docs/cc/struct/tensorflow/ops/approx-top-k/attrs#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs) When true, computes max-k; otherwise computes min-k. |\n| [RecallTarget](#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs_1a07b77c933dc0d54d2ea53620bbea8c01)`(float x)` | `TF_MUST_USE_RESULT `[Attrs](/api_docs/cc/struct/tensorflow/ops/approx-top-k/attrs#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs) Recall target for the approximation. |\n| [ReductionDimension](#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs_1aa21c37d0c1a3344a4b7129fcadc67fb2)`(int64 x)` | `TF_MUST_USE_RESULT `[Attrs](/api_docs/cc/struct/tensorflow/ops/approx-top-k/attrs#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs) Integer dimension along which to search. |\n| [ReductionInputSizeOverride](#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs_1a03875e3f7f1ec201e9e8e060d891250b)`(int64 x)` | `TF_MUST_USE_RESULT `[Attrs](/api_docs/cc/struct/tensorflow/ops/approx-top-k/attrs#structtensorflow_1_1ops_1_1_approx_top_k_1_1_attrs) When set to a positive value, it overrides the size determined by `input[reduction_dim]` for evaluating the recall. |\n\nPublic attributes\n-----------------\n\n### aggregate_to_topk_\n\n```verilog\nbool tensorflow::ops::ApproxTopK::Attrs::aggregate_to_topk_ = true\n``` \n\n### is_max_k_\n\n```scdoc\nbool tensorflow::ops::ApproxTopK::Attrs::is_max_k_ = true\n``` \n\n### recall_target_\n\n```scdoc\nfloat tensorflow::ops::ApproxTopK::Attrs::recall_target_ = 0.95f\n``` \n\n### reduction_dimension_\n\n```scdoc\nint64 tensorflow::ops::ApproxTopK::Attrs::reduction_dimension_ = -1\n``` \n\n### reduction_input_size_override_\n\n```scdoc\nint64 tensorflow::ops::ApproxTopK::Attrs::reduction_input_size_override_ = -1\n``` \n\nPublic functions\n----------------\n\n### AggregateToTopk\n\n```verilog\nTF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::AggregateToTopk(\n bool x\n)\n``` \nWhen true, aggregates approximate results to top-k.\n\nWhen false, returns the approximate results. The number of the approximate results is implementation defined and is greater equals to the specified `k`.\n\nDefaults to true \n\n### IsMaxK\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::IsMaxK(\n bool x\n)\n``` \nWhen true, computes max-k; otherwise computes min-k.\n\nDefaults to true \n\n### RecallTarget\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::RecallTarget(\n float x\n)\n``` \nRecall target for the approximation.\n\n[Range](/api_docs/cc/class/tensorflow/ops/range#classtensorflow_1_1ops_1_1_range) in (0,1\\]\n\nDefaults to 0.95 \n\n### ReductionDimension\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::ReductionDimension(\n int64 x\n)\n``` \nInteger dimension along which to search.\n\nDefault: -1.\n\nDefaults to -1 \n\n### ReductionInputSizeOverride\n\n```scdoc\nTF_MUST_USE_RESULT Attrs tensorflow::ops::ApproxTopK::Attrs::ReductionInputSizeOverride(\n int64 x\n)\n``` \nWhen set to a positive value, it overrides the size determined by `input[reduction_dim]` for evaluating the recall.\n\nThis 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.\n\nDefaults to -1"]]