覆盖 TensorFlow API 的默认实现的装饰器。
用法
tf.experimental.dispatch_for_api(
api, *signatures
)
参数
-
api
要覆盖的 TensorFlow API。 -
*signatures
字典将参数名称或索引映射到类型注释,指定何时调用调度目标。特别是,如果任何签名匹配,将调用调度目标;如果所有指定参数的类型都与指定的类型注释匹配,则签名匹配。如果未指定签名,则将从调度目标函数的类型注释中读取签名。
返回
-
覆盖
api
的默认实现的装饰器。
当使用与指定类型签名匹配的参数调用 API 时,装饰函数(称为 "dispatch target")将覆盖 API 的默认实现。使用将参数名称映射到类型注释的字典来指定签名。例如,在以下示例中,如果 x
和 y
都是 MaskedTensor
,则将为 tf.add
调用 masked_add
:
class MaskedTensor(tf.experimental.ExtensionType):
values:tf.Tensor
mask:tf.Tensor
@dispatch_for_api(tf.math.add, {'x':MaskedTensor, 'y':MaskedTensor})
def masked_add(x, y, name=None):
return MaskedTensor(x.values + y.values, x.mask & y.mask)
mt = tf.add(MaskedTensor([1, 2], [True, False]), MaskedTensor(10, True))
print(f"values={mt.values.numpy()}, mask={mt.mask.numpy()}")
values=[11 12], mask=[ True False]
如果指定了多个类型签名,则如果任何签名匹配,则将调用调度目标。例如,以下代码寄存器masked_add
如果被调用x
是一个MaskedTensor
或者 y
是一个MaskedTensor
.
@dispatch_for_api(tf.math.add, {'x':MaskedTensor}, {'y':MaskedTensor})
def masked_add(x, y):
x_values = x.values if isinstance(x, MaskedTensor) else x
x_mask = x.mask if isinstance(x, MaskedTensor) else True
y_values = y.values if isinstance(y, MaskedTensor) else y
y_mask = y.mask if isinstance(y, MaskedTensor) else True
return MaskedTensor(x_values + y_values, x_mask & y_mask)
类型签名中的类型注释可以是类型对象(例如 MaskedTensor
)、typing.List
值或 typing.Union
值。例如,如果values
是MaskedTensor
值的列表,则以下将注册要调用的masked_concat
:
@dispatch_for_api(tf.concat, {'values':typing.List[MaskedTensor]})
def masked_concat(values, axis):
return MaskedTensor(tf.concat([v.values for v in values], axis),
tf.concat([v.mask for v in values], axis))
每个类型签名必须包含至少一个 tf.CompositeTensor
的子类(包括 tf.ExtensionType
的子类),并且只有在至少一个 type-annotated 参数包含 CompositeTensor
值时才会触发调度。此规则避免在退化情况下调用调度,例如以下示例:
@dispatch_for_api(tf.concat, {'values':List[MaskedTensor]})
:当用户调用tf.concat([])
时,不会分派到修饰的分派目标。@dispatch_for_api(tf.add, {'x':Union[MaskedTensor, Tensor], 'y': Union[MaskedTensor, Tensor]})
:当用户调用时不会分派到装饰的分派目标tf.add(tf.constant(1), tf.constant(2))
.
调度目标的签名必须与被覆盖的 API 的签名相匹配。特别是,参数必须具有相同的名称,并且必须以相同的顺序出现。调度目标可以选择性地省略 "name" 参数,在这种情况下,它将在适当的时候通过对 tf.name_scope
的调用来包装。
注册的 API
@dispatch_for_api
可能覆盖的 TensorFlow API 是:
tf.__operators__.add(x, y, name)
tf.__operators__.eq(self, other)
tf.__operators__.getitem(tensor, slice_spec, var)
tf.__operators__.ne(self, other)
tf.__operators__.ragged_getitem(rt_input, key)
- tf.argsort
tf.audio.decode_wav(contents, desired_channels, desired_samples, name)
tf.audio.encode_wav(audio, sample_rate, name)
- tf.batch_to_space
- tf.bitcast
- tf.bitwise.bitwise_and
- tf.bitwise.bitwise_or
- tf.bitwise.bitwise_xor
- tf.bitwise.invert
- tf.bitwise.left_shift
- tf.bitwise.right_shift
- tf.boolean_mask
- tf.broadcast_dynamic_shape
- tf.broadcast_static_shape
- tf.broadcast_to
- tf.case
- tf.cast
- tf.clip_by_global_norm
- tf.clip_by_norm
- tf.clip_by_value
- tf.compat.v1.Print
- tf.compat.v1.arg_max
- tf.compat.v1.arg_min
tf.compat.v1.batch_gather(params, indices, name)
- tf.compat.v1.batch_to_space
- tf.compat.v1.batch_to_space_nd
- tf.compat.v1.boolean_mask
- tf.compat.v1.case
tf.compat.v1.clip_by_average_norm(t, clip_norm, name)
- tf.compat.v1.cond
- tf.compat.v1.convert_to_tensor
tf.compat.v1.debugging.assert_all_finite(t, msg, name, x, message)
- tf.compat.v1.assert_equal
- tf.compat.v1.assert_greater
- tf.compat.v1.assert_greater_equal
- tf.compat.v1.assert_integer
- tf.compat.v1.assert_less
- tf.compat.v1.assert_less_equal
- tf.compat.v1.assert_near
- tf.compat.v1.assert_negative
- tf.compat.v1.assert_non_negative
- tf.compat.v1.assert_non_positive
- tf.compat.v1.assert_none_equal
- tf.compat.v1.assert_positive
- tf.compat.v1.assert_rank
- tf.compat.v1.assert_rank_at_least
- tf.compat.v1.assert_rank_in
tf.compat.v1.debugging.assert_scalar(tensor, name, message)
- tf.compat.v1.debugging.assert_shapes
tf.compat.v1.debugging.assert_type(tensor, tf_type, message, name)
tf.compat.v1.decode_raw(input_bytes, out_type, little_endian, name, bytes)
tf.compat.v1.div(x, y, name)
- tf.compat.v1.expand_dims
tf.compat.v1.floor_div(x, y, name)
- tf.compat.v1.foldl
- tf.compat.v1.foldr
- tf.compat.v1.gather
- tf.compat.v1.gather_nd
tf.compat.v1.image.crop_and_resize(image, boxes, box_ind, crop_size, method, extrapolation_value, name, box_indices)
- tf.compat.v1.image.draw_bounding_boxes
- tf.compat.v1.image.extract_glimpse
tf.compat.v1.image.extract_image_patches(images, ksizes, strides, rates, padding, name, sizes)
tf.compat.v1.image.resize_area(images, size, align_corners, name)
tf.compat.v1.image.resize_bicubic(images, size, align_corners, name, half_pixel_centers)
tf.compat.v1.image.resize_bilinear(images, size, align_corners, name, half_pixel_centers)
tf.compat.v1.image.resize_image_with_pad(image, target_height, target_width, method, align_corners)
tf.compat.v1.image.resize_images(images, size, method, align_corners, preserve_aspect_ratio, name)
tf.compat.v1.image.resize_nearest_neighbor(images, size, align_corners, name, half_pixel_centers)
- tf.compat.v1.image.sample_distorted_bounding_box
tf.compat.v1.io.decode_csv(records, record_defaults, field_delim, use_quote_delim, name, na_value, select_cols)
- tf.compat.v1.parse_example
tf.compat.v1.io.parse_single_example(serialized, features, name, example_names)
tf.compat.v1.io.serialize_many_sparse(sp_input, name, out_type)
tf.compat.v1.io.serialize_sparse(sp_input, name, out_type)
tf.compat.v1.losses.absolute_difference(labels, predictions, weights, scope, loss_collection, reduction)
tf.compat.v1.losses.compute_weighted_loss(losses, weights, scope, loss_collection, reduction)
tf.compat.v1.losses.cosine_distance(labels, predictions, axis, weights, scope, loss_collection, reduction, dim)
tf.compat.v1.losses.hinge_loss(labels, logits, weights, scope, loss_collection, reduction)
- tf.compat.v1.losses.huber_loss
tf.compat.v1.losses.log_loss(labels, predictions, weights, epsilon, scope, loss_collection, reduction)
tf.compat.v1.losses.mean_pairwise_squared_error(labels, predictions, weights, scope, loss_collection)
- tf.compat.v1.losses.mean_squared_error
- tf.compat.v1.losses.sigmoid_cross_entropy
- tf.compat.v1.losses.softmax_cross_entropy
tf.compat.v1.losses.sparse_softmax_cross_entropy(labels, logits, weights, scope, loss_collection, reduction)
- tf.compat.v1.argmax
- tf.compat.v1.argmin
- tf.compat.v1.confusion_matrix
- tf.compat.v1.count_nonzero
tf.compat.v1.math.in_top_k(predictions, targets, k, name)
- tf.compat.v1.reduce_all
- tf.compat.v1.reduce_any
- tf.compat.v1.reduce_logsumexp
- tf.compat.v1.reduce_max
- tf.compat.v1.reduce_mean
- tf.compat.v1.reduce_min
- tf.compat.v1.reduce_prod
- tf.compat.v1.reduce_sum
- tf.compat.v1.scalar_mul
tf.compat.v1.nn.avg_pool(value, ksize, strides, padding, data_format, name, input)
tf.compat.v1.nn.batch_norm_with_global_normalization(t, m, v, beta, gamma, variance_epsilon, scale_after_normalization, name, input, mean, variance)
tf.compat.v1.nn.bidirectional_dynamic_rnn(cell_fw, cell_bw, inputs, sequence_length, initial_state_fw, initial_state_bw, dtype, parallel_iterations, swap_memory, time_major, scope)
tf.compat.v1.nn.conv1d(value, filters, stride, padding, use_cudnn_on_gpu, data_format, name, input, dilations)
- tf.compat.v1.nn.conv2d
tf.compat.v1.nn.conv2d_backprop_filter(input, filter_sizes, out_backprop, strides, padding, use_cudnn_on_gpu, data_format, dilations, name)
tf.compat.v1.nn.conv2d_backprop_input(input_sizes, filter, out_backprop, strides, padding, use_cudnn_on_gpu, data_format, dilations, name, filters)
tf.compat.v1.nn.conv2d_transpose(value, filter, output_shape, strides, padding, data_format, name, input, filters, dilations)
tf.compat.v1.nn.conv3d(input, filter, strides, padding, data_format, dilations, name, filters)
tf.compat.v1.nn.conv3d_backprop_filter(input, filter_sizes, out_backprop, strides, padding, data_format, dilations, name)
tf.compat.v1.nn.conv3d_transpose(value, filter, output_shape, strides, padding, data_format, name, input, filters, dilations)
- tf.compat.v1.nn.convolution
tf.compat.v1.nn.crelu(features, name, axis)
tf.compat.v1.nn.ctc_beam_search_decoder(inputs, sequence_length, beam_width, top_paths, merge_repeated)
- tf.compat.v1.nn.ctc_loss
tf.compat.v1.nn.ctc_loss_v2(labels, logits, label_length, logit_length, logits_time_major, unique, blank_index, name)
- tf.compat.v1.depth_to_space
- tf.compat.v1.nn.depthwise_conv2d
- tf.compat.v1.nn.depthwise_conv2d_native
- tf.compat.v1.nn.dilation2d
tf.compat.v1.nn.dropout(x, keep_prob, noise_shape, seed, name, rate)
- tf.compat.v1.nn.dynamic_rnn
tf.compat.v1.nn.embedding_lookup(params, ids, partition_strategy, name, validate_indices, max_norm)
- tf.compat.v1.nn.embedding_lookup_sparse
- tf.compat.v1.nn.erosion2d
tf.compat.v1.nn.fractional_avg_pool(value, pooling_ratio, pseudo_random, overlapping, deterministic, seed, seed2, name)
tf.compat.v1.nn.fractional_max_pool(value, pooling_ratio, pseudo_random, overlapping, deterministic, seed, seed2, name)
tf.compat.v1.nn.fused_batch_norm(x, scale, offset, mean, variance, epsilon, data_format, is_training, name, exponential_avg_factor)
- tf.compat.v1.math.log_softmax
tf.compat.v1.nn.max_pool(value, ksize, strides, padding, data_format, name, input)
tf.compat.v1.nn.max_pool_with_argmax(input, ksize, strides, padding, data_format, Targmax, name, output_dtype, include_batch_in_index)
tf.compat.v1.nn.moments(x, axes, shift, name, keep_dims, keepdims)
- tf.compat.v1.nn.nce_loss
- tf.compat.v1.nn.pool
tf.compat.v1.nn.quantized_avg_pool(input, min_input, max_input, ksize, strides, padding, name)
tf.compat.v1.nn.quantized_conv2d(input, filter, min_input, max_input, min_filter, max_filter, strides, padding, out_type, dilations, name)
tf.compat.v1.nn.quantized_max_pool(input, min_input, max_input, ksize, strides, padding, name)
tf.compat.v1.nn.quantized_relu_x(features, max_value, min_features, max_features, out_type, name)
- tf.compat.v1.nn.raw_rnn
tf.compat.v1.nn.relu_layer(x, weights, biases, name)
- tf.compat.v1.nn.safe_embedding_lookup_sparse
- tf.compat.v1.nn.sampled_softmax_loss
- tf.compat.v1.nn.separable_conv2d
- tf.compat.v1.nn.sigmoid_cross_entropy_with_logits
- tf.compat.v1.math.softmax
tf.compat.v1.nn.softmax_cross_entropy_with_logits(_sentinel, labels, logits, dim, name, axis)
tf.compat.v1.nn.softmax_cross_entropy_with_logits_v2(labels, logits, axis, name, dim)
- tf.compat.v1.space_to_batch
- tf.compat.v1.space_to_depth
tf.compat.v1.nn.sparse_softmax_cross_entropy_with_logits(_sentinel, labels, logits, name)
tf.compat.v1.nn.static_bidirectional_rnn(cell_fw, cell_bw, inputs, initial_state_fw, initial_state_bw, dtype, sequence_length, scope)
- tf.compat.v1.nn.static_rnn
tf.compat.v1.nn.static_state_saving_rnn(cell, inputs, state_saver, state_name, sequence_length, scope)
- tf.compat.v1.nn.sufficient_statistics
- tf.compat.v1.nn.weighted_cross_entropy_with_logits
tf.compat.v1.nn.weighted_moments(x, axes, frequency_weights, name, keep_dims, keepdims)
tf.compat.v1.nn.xw_plus_b(x, weights, biases, name)
tf.compat.v1.norm(tensor, ord, axis, keepdims, name, keep_dims)
- tf.compat.v1.ones_like
- tf.compat.v1.pad
- tf.compat.v1.py_func
tf.compat.v1.quantize_v2(input, min_range, max_range, T, mode, name, round_mode, narrow_range, axis, ensure_minimum_range)
- tf.compat.v1.ragged.constant_value
tf.compat.v1.ragged.placeholder(dtype, ragged_rank, value_shape, name)
- tf.compat.v1.multinomial
- tf.compat.v1.random_poisson
- tf.compat.v1.random.stateless_multinomial
- tf.compat.v1.scan
- tf.compat.v1.setdiff1d
- tf.compat.v1.shape
- tf.compat.v1.size
- tf.compat.v1.sparse_to_dense
- tf.compat.v1.squeeze
- tf.compat.v1.string_split
- tf.compat.v1.strings.length
- tf.compat.v1.reduce_join
- tf.compat.v1.strings.split
- tf.compat.v1.strings.substr
tf.compat.v1.strings.to_hash_bucket(string_tensor, num_buckets, name, input)
- tf.compat.v1.string_to_number
- tf.compat.v1.substr
- tf.compat.v1.to_bfloat16
- tf.compat.v1.to_complex128
- tf.compat.v1.to_complex64
- tf.compat.v1.to_double
- tf.compat.v1.to_float
- tf.compat.v1.to_int32
- tf.compat.v1.to_int64
tf.compat.v1.train.sdca_fprint(input, name)
tf.compat.v1.train.sdca_optimizer(sparse_example_indices, sparse_feature_indices, sparse_feature_values, dense_features, example_weights, example_labels, sparse_indices, sparse_weights, dense_weights, example_state_data, loss_type, l1, l2, num_loss_partitions, num_inner_iterations, adaptative, name)
tf.compat.v1.train.sdca_shrink_l1(weights, l1, l2, name)
- tf.compat.v1.transpose
tf.compat.v1.tuple(tensors, name, control_inputs)
- tf.compat.v1.where
- tf.compat.v1.zeros_like
- tf.concat
- tf.cond
- tf.convert_to_tensor
tf.create_trt_resource_handle(resource_name, name)
- tf.debugging.Assert
tf.debugging.assert_all_finite(x, message, name)
tf.debugging.assert_equal(x, y, message, summarize, name)
tf.debugging.assert_greater(x, y, message, summarize, name)
tf.debugging.assert_greater_equal(x, y, message, summarize, name)
tf.debugging.assert_integer(x, message, name)
tf.debugging.assert_less(x, y, message, summarize, name)
tf.debugging.assert_less_equal(x, y, message, summarize, name)
tf.debugging.assert_near(x, y, rtol, atol, message, summarize, name)
tf.debugging.assert_negative(x, message, summarize, name)
tf.debugging.assert_non_negative(x, message, summarize, name)
tf.debugging.assert_non_positive(x, message, summarize, name)
tf.debugging.assert_none_equal(x, y, summarize, message, name)
tf.debugging.assert_positive(x, message, summarize, name)
tf.debugging.assert_proper_iterable(values)
tf.debugging.assert_rank(x, rank, message, name)
tf.debugging.assert_rank_at_least(x, rank, message, name)
tf.debugging.assert_rank_in(x, ranks, message, name)
tf.debugging.assert_same_float_dtype(tensors, dtype)
tf.debugging.assert_scalar(tensor, message, name)
- tf.debugging.assert_shapes
- tf.debugging.assert_type
- tf.debugging.check_numerics
- tf.dtypes.complex
tf.dtypes.saturate_cast(value, dtype, name)
- tf.dynamic_partition
- tf.dynamic_stitch
- tf.edit_distance
- tf.ensure_shape
- tf.expand_dims
- tf.extract_volume_patches
- tf.eye
- tf.fill
- tf.fingerprint
- tf.foldl
- tf.foldr
- tf.gather
- tf.gather_nd
tf.get_calibration_data_op(resource_name, name)
- tf.histogram_fixed_width
- tf.histogram_fixed_width_bins
- tf.identity
- tf.identity_n
- tf.image.adjust_brightness
- tf.image.adjust_contrast
- tf.image.adjust_gamma
- tf.image.adjust_hue
- tf.image.adjust_jpeg_quality
- tf.image.adjust_saturation
- tf.image.central_crop
tf.image.combined_non_max_suppression(boxes, scores, max_output_size_per_class, max_total_size, iou_threshold, score_threshold, pad_per_class, clip_boxes, name)
- tf.image.convert_image_dtype
- tf.image.crop_and_resize
- tf.image.crop_to_bounding_box
- tf.image.draw_bounding_boxes
- tf.image.extract_glimpse
- tf.image.extract_patches
- tf.image.flip_left_right
- tf.image.flip_up_down
tf.image.generate_bounding_box_proposals(scores, bbox_deltas, image_info, anchors, nms_threshold, pre_nms_topn, min_size, post_nms_topn, name)
- tf.image.grayscale_to_rgb
tf.image.hsv_to_rgb(images, name)
- tf.image.image_gradients
- tf.image.non_max_suppression
- tf.image.non_max_suppression_overlaps
- tf.image.non_max_suppression_padded
- tf.image.non_max_suppression_with_scores
- tf.image.pad_to_bounding_box
- tf.image.per_image_standardization
- tf.image.psnr
- tf.image.random_brightness
- tf.image.random_contrast
- tf.image.random_crop
- tf.image.random_flip_left_right
- tf.image.random_flip_up_down
- tf.image.random_hue
- tf.image.random_jpeg_quality
- tf.image.random_saturation
- tf.image.resize
- tf.image.resize_with_crop_or_pad
tf.image.resize_with_pad(image, target_height, target_width, method, antialias)
- tf.image.rgb_to_grayscale
- tf.image.rgb_to_hsv
- tf.image.rgb_to_yiq
tf.image.rgb_to_yuv(images)
- tf.image.rot90
- tf.image.sample_distorted_bounding_box
- tf.image.sobel_edges
- tf.image.ssim
tf.image.ssim_multiscale(img1, img2, max_val, power_factors, filter_size, filter_sigma, k1, k2)
- tf.image.stateless_random_brightness
- tf.image.stateless_random_contrast
- tf.image.stateless_random_crop
- tf.image.stateless_random_flip_left_right
- tf.image.stateless_random_flip_up_down
- tf.image.stateless_random_hue
- tf.image.stateless_random_jpeg_quality
- tf.image.stateless_random_saturation
- tf.image.stateless_sample_distorted_bounding_box
tf.image.total_variation(images, name)
- tf.image.transpose
tf.image.yiq_to_rgb(images)
- tf.image.yuv_to_rgb
tf.initialize_trt_resource(resource_handle, filename, max_cached_engines_count, name)
tf.io.decode_and_crop_jpeg(contents, crop_window, channels, ratio, fancy_upscaling, try_recover_truncated, acceptable_fraction, dct_method, name)
tf.io.decode_base64(input, name)
tf.io.decode_bmp(contents, channels, name)
tf.io.decode_compressed(bytes, compression_type, name)
tf.io.decode_csv(records, record_defaults, field_delim, use_quote_delim, na_value, select_cols, name)
- tf.io.decode_gif
tf.io.decode_image(contents, channels, dtype, name, expand_animations)
tf.io.decode_jpeg(contents, channels, ratio, fancy_upscaling, try_recover_truncated, acceptable_fraction, dct_method, name)
tf.io.decode_png(contents, channels, dtype, name)
- tf.io.decode_proto
- tf.io.decode_raw
- tf.io.deserialize_many_sparse
tf.io.encode_base64(input, pad, name)
tf.io.encode_jpeg(image, format, quality, progressive, optimize_size, chroma_downsampling, density_unit, x_density, y_density, xmp_metadata, name)
tf.io.encode_png(image, compression, name)
tf.io.encode_proto(sizes, values, field_names, message_type, descriptor_source, name)
tf.io.extract_jpeg_shape(contents, output_type, name)
tf.io.matching_files(pattern, name)
- tf.io.parse_example
tf.io.parse_sequence_example(serialized, context_features, sequence_features, example_names, name)
tf.io.parse_single_example(serialized, features, example_names, name)
tf.io.parse_single_sequence_example(serialized, context_features, sequence_features, example_name, name)
tf.io.parse_tensor(serialized, out_type, name)
tf.io.serialize_many_sparse(sp_input, out_type, name)
tf.io.serialize_sparse(sp_input, out_type, name)
tf.io.write_file(filename, contents, name)
- tf.linalg.adjoint
- tf.linalg.band_part
tf.linalg.cholesky(input, name)
- tf.linalg.cholesky_solve
tf.linalg.cross(a, b, name)
tf.linalg.det(input, name)
- tf.linalg.diag
- tf.linalg.diag_part
tf.linalg.eig(tensor, name)
tf.linalg.eigh(tensor, name)
- tf.linalg.eigh_tridiagonal
tf.linalg.eigvals(tensor, name)
tf.linalg.eigvalsh(tensor, name)
tf.linalg.experimental.conjugate_gradient(operator, rhs, preconditioner, x, tol, max_iter, name)
tf.linalg.expm(input, name)
tf.linalg.global_norm(t_list, name)
tf.linalg.inv(input, adjoint, name)
- tf.linalg.logdet
tf.linalg.logm(input, name)
tf.linalg.lstsq(matrix, rhs, l2_regularizer, fast, name)
tf.linalg.lu(input, output_idx_type, name)
- tf.linalg.lu_matrix_inverse
- tf.linalg.lu_reconstruct
- tf.linalg.lu_solve
- tf.linalg.matmul
tf.linalg.matrix_rank(a, tol, validate_args, name)
- tf.linalg.matrix_transpose
- tf.linalg.matvec
tf.linalg.normalize(tensor, ord, axis, name)
- tf.linalg.pinv
- tf.linalg.qr
- tf.linalg.set_diag
tf.linalg.slogdet(input, name)
tf.linalg.solve(matrix, rhs, adjoint, name)
tf.linalg.sqrtm(input, name)
- tf.linalg.svd
- tf.linalg.tensor_diag
- tf.linalg.tensor_diag_part
- tf.linalg.trace
- tf.linalg.triangular_solve
- tf.linalg.tridiagonal_matmul
- tf.linalg.tridiagonal_solve
- tf.linspace
- tf.math.abs
- tf.math.accumulate_n
- tf.math.acos
- tf.math.acosh
- tf.math.add
- tf.math.add_n
- tf.math.angle
- tf.math.argmax
- tf.math.argmin
- tf.math.asin
- tf.math.asinh
- tf.math.atan
- tf.math.atan2
- tf.math.atanh
- tf.math.bessel_i0
- tf.math.bessel_i0e
- tf.math.bessel_i1
- tf.math.bessel_i1e
tf.math.betainc(a, b, x, name)
- tf.math.ceil
- tf.math.confusion_matrix
- tf.math.conj
- tf.math.cos
- tf.math.cosh
- tf.math.count_nonzero
- tf.math.cumprod
- tf.math.cumsum
- tf.math.cumulative_logsumexp
tf.math.digamma(x, name)
- tf.math.divide
- tf.math.divide_no_nan
- tf.math.equal
- tf.math.erf
tf.math.erfc(x, name)
- tf.math.erfcinv
tf.math.erfinv(x, name)
- tf.math.exp
- tf.math.expm1
- tf.math.floor
tf.math.floordiv(x, y, name)
tf.math.floormod(x, y, name)
- tf.math.greater
- tf.math.greater_equal
tf.math.igamma(a, x, name)
tf.math.igammac(a, x, name)
- tf.math.imag
tf.math.in_top_k(targets, predictions, k, name)
- tf.math.invert_permutation
- tf.math.is_finite
- tf.math.is_inf
- tf.math.is_nan
- tf.math.is_non_decreasing
- tf.math.is_strictly_increasing
- tf.math.l2_normalize
tf.math.lbeta(x, name)
- tf.math.less
- tf.math.less_equal
- tf.math.lgamma
- tf.math.log
- tf.math.log1p
- tf.math.log_sigmoid
- tf.math.logical_and
- tf.math.logical_not
- tf.math.logical_or
- tf.math.logical_xor
- tf.math.maximum
- tf.math.minimum
- tf.math.multiply
tf.math.multiply_no_nan(x, y, name)
tf.math.ndtri(x, name)
tf.math.negative(x, name)
tf.math.nextafter(x1, x2, name)
- tf.math.not_equal
tf.math.polygamma(a, x, name)
- tf.math.polyval
- tf.math.pow
- tf.math.real
tf.math.reciprocal(x, name)
- tf.math.reciprocal_no_nan
- tf.math.reduce_all
- tf.math.reduce_any
- tf.math.reduce_euclidean_norm
- tf.math.reduce_logsumexp
- tf.math.reduce_max
- tf.math.reduce_mean
- tf.math.reduce_min
- tf.math.reduce_prod
- tf.math.reduce_std
- tf.math.reduce_sum
- tf.math.reduce_variance
- tf.math.rint
- tf.math.round
- tf.math.rsqrt
- tf.math.scalar_mul
- tf.math.segment_max
- tf.math.segment_mean
- tf.math.segment_min
- tf.math.segment_prod
- tf.math.segment_sum
- tf.math.sigmoid
- tf.math.sign
- tf.math.sin
- tf.math.sinh
tf.math.sobol_sample(dim, num_results, skip, dtype, name)
- tf.math.softplus
- tf.math.special.bessel_j0
- tf.math.special.bessel_j1
- tf.math.special.bessel_k0
- tf.math.special.bessel_k0e
- tf.math.special.bessel_k1
- tf.math.special.bessel_k1e
- tf.math.special.bessel_y0
- tf.math.special.bessel_y1
- tf.math.special.dawsn
- tf.math.special.expint
- tf.math.special.fresnel_cos
- tf.math.special.fresnel_sin
- tf.math.special.spence
- tf.math.sqrt
- tf.math.square
tf.math.squared_difference(x, y, name)
- tf.math.subtract
- tf.math.tan
- tf.math.tanh
- tf.math.top_k
tf.math.truediv(x, y, name)
- tf.math.unsorted_segment_max
tf.math.unsorted_segment_mean(data, segment_ids, num_segments, name)
- tf.math.unsorted_segment_min
- tf.math.unsorted_segment_prod
tf.math.unsorted_segment_sqrt_n(data, segment_ids, num_segments, name)
- tf.math.unsorted_segment_sum
tf.math.xdivy(x, y, name)
- tf.math.xlog1py
tf.math.xlogy(x, y, name)
- tf.math.zero_fraction
tf.math.zeta(x, q, name)
- tf.nn.atrous_conv2d
tf.nn.atrous_conv2d_transpose(value, filters, output_shape, rate, padding, name)
tf.nn.avg_pool(input, ksize, strides, padding, data_format, name)
tf.nn.avg_pool1d(input, ksize, strides, padding, data_format, name)
tf.nn.avg_pool2d(input, ksize, strides, padding, data_format, name)
tf.nn.avg_pool3d(input, ksize, strides, padding, data_format, name)
tf.nn.batch_norm_with_global_normalization(input, mean, variance, beta, gamma, variance_epsilon, scale_after_normalization, name)
tf.nn.batch_normalization(x, mean, variance, offset, scale, variance_epsilon, name)
tf.nn.bias_add(value, bias, data_format, name)
tf.nn.collapse_repeated(labels, seq_length, name)
tf.nn.compute_accidental_hits(true_classes, sampled_candidates, num_true, seed, name)
- tf.nn.compute_average_loss
tf.nn.conv1d(input, filters, stride, padding, data_format, dilations, name)
tf.nn.conv1d_transpose(input, filters, output_shape, strides, padding, data_format, dilations, name)
- tf.nn.conv2d
tf.nn.conv2d_transpose(input, filters, output_shape, strides, padding, data_format, dilations, name)
tf.nn.conv3d(input, filters, strides, padding, data_format, dilations, name)
tf.nn.conv3d_transpose(input, filters, output_shape, strides, padding, data_format, dilations, name)
tf.nn.conv_transpose(input, filters, output_shape, strides, padding, data_format, dilations, name)
- tf.nn.convolution
tf.nn.crelu(features, axis, name)
tf.nn.ctc_beam_search_decoder(inputs, sequence_length, beam_width, top_paths)
- tf.nn.ctc_greedy_decoder
tf.nn.ctc_loss(labels, logits, label_length, logit_length, logits_time_major, unique, blank_index, name)
tf.nn.ctc_unique_labels(labels, name)
- tf.nn.depth_to_space
- tf.nn.depthwise_conv2d
tf.nn.depthwise_conv2d_backprop_filter(input, filter_sizes, out_backprop, strides, padding, data_format, dilations, name)
tf.nn.depthwise_conv2d_backprop_input(input_sizes, filter, out_backprop, strides, padding, data_format, dilations, name)
- tf.nn.dilation2d
- tf.nn.dropout
- tf.nn.elu
- tf.nn.embedding_lookup
- tf.nn.embedding_lookup_sparse
- tf.nn.erosion2d
- tf.nn.experimental.stateless_dropout
tf.nn.fractional_avg_pool(value, pooling_ratio, pseudo_random, overlapping, seed, name)
tf.nn.fractional_max_pool(value, pooling_ratio, pseudo_random, overlapping, seed, name)
- tf.nn.gelu
- tf.nn.isotonic_regression
- tf.nn.l2_loss
tf.nn.leaky_relu(features, alpha, name)
- tf.nn.local_response_normalization
- tf.nn.log_poisson_loss
- tf.nn.log_softmax
- tf.nn.max_pool
tf.nn.max_pool1d(input, ksize, strides, padding, data_format, name)
- tf.nn.max_pool2d
tf.nn.max_pool3d(input, ksize, strides, padding, data_format, name)
tf.nn.max_pool_with_argmax(input, ksize, strides, padding, data_format, output_dtype, include_batch_in_index, name)
tf.nn.moments(x, axes, shift, keepdims, name)
- tf.nn.nce_loss
tf.nn.normalize_moments(counts, mean_ss, variance_ss, shift, name)
- tf.nn.pool
- tf.nn.relu
- tf.nn.relu6
- tf.nn.safe_embedding_lookup_sparse
- tf.nn.sampled_softmax_loss
- tf.nn.scale_regularization_loss
tf.nn.selu(features, name)
- tf.nn.separable_conv2d
- tf.nn.sigmoid_cross_entropy_with_logits
tf.nn.silu(features, beta)
- tf.nn.softmax
- tf.nn.softmax_cross_entropy_with_logits
tf.nn.softsign(features, name)
- tf.nn.space_to_depth
- tf.nn.sparse_softmax_cross_entropy_with_logits
tf.nn.sufficient_statistics(x, axes, shift, keepdims, name)
- tf.nn.weighted_cross_entropy_with_logits
tf.nn.weighted_moments(x, axes, frequency_weights, keepdims, name)
tf.nn.with_space_to_batch(input, dilation_rate, padding, op, filter_shape, spatial_dims, data_format)
tf.no_op(name)
tf.norm(tensor, ord, axis, keepdims, name)
- tf.numpy_function
- tf.one_hot
- tf.ones
- tf.ones_like
- tf.pad
- tf.parallel_stack
- tf.py_function
- tf.quantization.dequantize
tf.quantization.fake_quant_with_min_max_args(inputs, min, max, num_bits, narrow_range, name)
tf.quantization.fake_quant_with_min_max_args_gradient(gradients, inputs, min, max, num_bits, narrow_range, name)
tf.quantization.fake_quant_with_min_max_vars(inputs, min, max, num_bits, narrow_range, name)
tf.quantization.fake_quant_with_min_max_vars_gradient(gradients, inputs, min, max, num_bits, narrow_range, name)
tf.quantization.fake_quant_with_min_max_vars_per_channel(inputs, min, max, num_bits, narrow_range, name)
tf.quantization.fake_quant_with_min_max_vars_per_channel_gradient(gradients, inputs, min, max, num_bits, narrow_range, name)
- tf.quantization.quantize
tf.quantization.quantize_and_dequantize(input, input_min, input_max, signed_input, num_bits, range_given, round_mode, name, narrow_range, axis)
- tf.quantization.quantize_and_dequantize_v2
tf.quantization.quantized_concat(concat_dim, values, input_mins, input_maxes, name)
- tf.ragged.boolean_mask
- tf.ragged.constant
- tf.ragged.cross
- tf.ragged.cross_hashed
- tf.ragged.range
- tf.ragged.row_splits_to_segment_ids
- tf.ragged.segment_ids_to_row_splits
- tf.ragged.stack
- tf.ragged.stack_dynamic_partitions
- tf.random.categorical
- tf.random.experimental.stateless_fold_in
- tf.random.experimental.stateless_split
tf.random.fixed_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, vocab_file, distortion, num_reserved_ids, num_shards, shard, unigrams, seed, name)
- tf.random.gamma
tf.random.learned_unigram_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed, name)
tf.random.log_uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed, name)
- tf.random.normal
- tf.random.poisson
- tf.random.shuffle
- tf.random.stateless_binomial
- tf.random.stateless_categorical
- tf.random.stateless_gamma
tf.random.stateless_normal(shape, seed, mean, stddev, dtype, name, alg)
- tf.random.stateless_parameterized_truncated_normal
- tf.random.stateless_poisson
tf.random.stateless_truncated_normal(shape, seed, mean, stddev, dtype, name, alg)
- tf.random.stateless_uniform
- tf.random.truncated_normal
- tf.random.uniform
tf.random.uniform_candidate_sampler(true_classes, num_true, num_sampled, unique, range_max, seed, name)
- tf.range
- tf.rank
tf.realdiv(x, y, name)
- tf.repeat
- tf.reshape
- tf.reverse
- tf.reverse_sequence
- tf.roll
- tf.scan
- tf.scatter_nd
- tf.searchsorted
- tf.sequence_mask
tf.serialize_trt_resource(resource_name, filename, delete_resource, save_gpu_specific_engines, name)
- tf.sets.difference
- tf.sets.intersection
tf.sets.size(a, validate_indices)
- tf.sets.union
- tf.shape
tf.shape_n(input, out_type, name)
tf.signal.dct(input, type, n, axis, norm, name)
tf.signal.fft(input, name)
tf.signal.fft2d(input, name)
tf.signal.fft3d(input, name)
- tf.signal.fftshift
- tf.signal.frame
tf.signal.hamming_window(window_length, periodic, dtype, name)
tf.signal.hann_window(window_length, periodic, dtype, name)
tf.signal.idct(input, type, n, axis, norm, name)
tf.signal.ifft(input, name)
tf.signal.ifft2d(input, name)
tf.signal.ifft3d(input, name)
- tf.signal.ifftshift
- tf.signal.inverse_mdct
- tf.signal.inverse_stft
tf.signal.inverse_stft_window_fn(frame_step, forward_window_fn, name)
tf.signal.irfft(input_tensor, fft_length, name)
tf.signal.irfft2d(input_tensor, fft_length, name)
tf.signal.irfft3d(input_tensor, fft_length, name)
tf.signal.kaiser_bessel_derived_window(window_length, beta, dtype, name)
tf.signal.kaiser_window(window_length, beta, dtype, name)
- tf.signal.linear_to_mel_weight_matrix
tf.signal.mdct(signals, frame_length, window_fn, pad_end, norm, name)
- tf.signal.mfccs_from_log_mel_spectrograms
- tf.signal.overlap_and_add
tf.signal.rfft(input_tensor, fft_length, name)
tf.signal.rfft2d(input_tensor, fft_length, name)
tf.signal.rfft3d(input_tensor, fft_length, name)
tf.signal.stft(signals, frame_length, frame_step, fft_length, window_fn, pad_end, name)
tf.signal.vorbis_window(window_length, dtype, name)
- tf.size
- tf.slice
- tf.sort
- tf.space_to_batch
- tf.space_to_batch_nd
- tf.split
- tf.squeeze
- tf.stack
- tf.stop_gradient
- tf.strided_slice
- tf.strings.as_string
- tf.strings.bytes_split
- tf.strings.format
- tf.strings.join
- tf.strings.length
- tf.strings.lower
- tf.strings.ngrams
- tf.strings.reduce_join
- tf.strings.regex_full_match
- tf.strings.regex_replace
- tf.strings.split
- tf.strings.strip
- tf.strings.substr
- tf.strings.to_hash_bucket
- tf.strings.to_hash_bucket_fast
- tf.strings.to_hash_bucket_strong
- tf.strings.to_number
- tf.strings.unicode_decode
- tf.strings.unicode_decode_with_offsets
- tf.strings.unicode_encode
- tf.strings.unicode_script
- tf.strings.unicode_split
- tf.strings.unicode_split_with_offsets
- tf.strings.unicode_transcode
- tf.strings.unsorted_segment_join
- tf.strings.upper
- tf.tensor_scatter_nd_add
- tf.tensor_scatter_nd_max
tf.tensor_scatter_nd_min(tensor, indices, updates, name)
- tf.tensor_scatter_nd_sub
- tf.tensor_scatter_nd_update
tf.tensordot(a, b, axes, name)
- tf.tile
tf.timestamp(name)
- tf.transpose
tf.trt_engine_op(in_tensor, serialized_segment, OutT, workspace_size_bytes, precision_mode, segment_func, input_shapes, output_shapes, max_cached_engines_count, max_batch_size, calibration_data, use_calibration, segment_funcdef_name, cached_engine_batches, fixed_input_size, static_engine, profile_strategy, use_explicit_precision, name)
tf.truncatediv(x, y, name)
tf.truncatemod(x, y, name)
tf.tuple(tensors, control_inputs, name)
- tf.unique
- tf.unique_with_counts
- tf.unravel_index
- tf.unstack
- tf.where
tf.xla_all_reduce(input, group_assignment, reduce_op, mode, name)
tf.xla_broadcast_helper(lhs, rhs, broadcast_dims, name)
tf.xla_cluster_output(input, name)
tf.xla_conv(lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, feature_group_count, dimension_numbers, precision_config, name)
tf.xla_conv_v2(lhs, rhs, window_strides, padding, lhs_dilation, rhs_dilation, feature_group_count, dimension_numbers, precision_config, preferred_element_type, batch_group_count, name)
tf.xla_dequantize(input, min_range, max_range, mode, transpose_output, name)
tf.xla_dot(lhs, rhs, dimension_numbers, precision_config, name)
tf.xla_dot_v2(lhs, rhs, dimension_numbers, precision_config, preferred_element_type, name)
tf.xla_dynamic_slice(input, start_indices, size_indices, name)
tf.xla_dynamic_update_slice(input, update, indices, name)
tf.xla_einsum(a, b, equation, name)
tf.xla_gather(operand, start_indices, slice_sizes, dimension_numbers, indices_are_sorted, name)
tf.xla_if(cond, inputs, then_branch, else_branch, Tout, name)
tf.xla_key_value_sort(keys, values, name)
tf.xla_launch(constants, args, resources, Tresults, function, name)
tf.xla_pad(input, padding_value, padding_low, padding_high, padding_interior, name)
tf.xla_recv(dtype, tensor_name, shape, name)
tf.xla_reduce(input, init_value, dimensions_to_reduce, reducer, name)
tf.xla_reduce_scatter(input, group_assignment, scatter_dimension, reduce_op, name)
tf.xla_reduce_window(input, init_value, window_dimensions, window_strides, base_dilations, window_dilations, padding, computation, name)
tf.xla_remove_dynamic_dimension_size(input, dim_index, name)
tf.xla_replica_id(name)
tf.xla_rng_bit_generator(algorithm, initial_state, shape, dtype, name)
tf.xla_scatter(operand, scatter_indices, updates, update_computation, dimension_numbers, indices_are_sorted, name)
tf.xla_select_and_scatter(operand, window_dimensions, window_strides, padding, source, init_value, select, scatter, name)
tf.xla_self_adjoint_eig(a, lower, max_iter, epsilon, name)
tf.xla_send(tensor, tensor_name, name)
tf.xla_set_bound(input, bound, name)
tf.xla_set_dynamic_dimension_size(input, dim_index, size, name)
tf.xla_sharding(input, sharding, unspecified_dims, name)
tf.xla_sort(input, name)
tf.xla_spmd_full_to_shard_shape(input, manual_sharding, dim, unspecified_dims, name)
tf.xla_spmd_shard_to_full_shape(input, manual_sharding, full_shape, dim, unspecified_dims, name)
tf.xla_svd(a, max_iter, epsilon, precision_config, name)
tf.xla_variadic_reduce(input, init_value, dimensions_to_reduce, reducer, name)
tf.xla_variadic_reduce_v2(inputs, init_values, dimensions_to_reduce, reducer, name)
tf.xla_variadic_sort(inputs, dimension, comparator, is_stable, name)
tf.xla_while(input, cond, body, name)
- tf.zeros
- tf.zeros_like
相关用法
- Python tf.experimental.dispatch_for_unary_elementwise_apis用法及代码示例
- Python tf.experimental.dispatch_for_binary_elementwise_apis用法及代码示例
- Python tf.experimental.dlpack.from_dlpack用法及代码示例
- Python tf.experimental.dlpack.to_dlpack用法及代码示例
- Python tf.experimental.numpy.iinfo用法及代码示例
- Python tf.experimental.Optional.has_value用法及代码示例
- Python tf.experimental.unregister_dispatch_for用法及代码示例
- Python tf.experimental.tensorrt.Converter用法及代码示例
- Python tf.experimental.ExtensionType用法及代码示例
- Python tf.experimental.Optional.get_value用法及代码示例
- Python tf.experimental.numpy.issubdtype用法及代码示例
- Python tf.experimental.numpy.unicode_用法及代码示例
- Python tf.experimental.async_scope用法及代码示例
- Python tf.experimental.Optional.empty用法及代码示例
- Python tf.experimental.numpy.float16.as_integer_ratio用法及代码示例
- Python tf.experimental.numpy.float64.as_integer_ratio用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.experimental.dispatch_for_api。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。