tensorflow::ops::ApproxTopK::Attrs

#include <nn_ops.h>

Optional attribute setters for ApproxTopK.

Summary

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.

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

reduction_input_size_override_

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

ReductionInputSizeOverride

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