doc_content
stringlengths
1
386k
doc_id
stringlengths
5
188
tf.estimator.NanLossDuringTrainingError Unspecified run-time error. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.NanLossDuringTrainingError, tf.compat.v1.train.NanLossDuringTrainingError tf.estimator.NanLossDuringTrainingError( *args, **kwargs )
tensorflow.estimator.nanlossduringtrainingerror
tf.estimator.NanTensorHook Monitors the loss tensor and stops training if loss is NaN. Inherits From: SessionRunHook View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.NanTensorHook, tf.compat.v1.train.NanTensorHook tf.estimator.NanTensorHook( loss_tensor, fail_on_nan_loss=True ) Can either fail with exception or just stop training. Args loss_tensor Tensor, the loss tensor. fail_on_nan_loss bool, whether to raise exception when loss is NaN. Methods after_create_session View source after_create_session( session, coord ) Called when new TensorFlow session is created. This is called to signal the hooks that a new session has been created. This has two essential differences with the situation in which begin is called: When this is called, the graph is finalized and ops can no longer be added to the graph. This method will also be called as a result of recovering a wrapped session, not only at the beginning of the overall session. Args session A TensorFlow Session that has been created. coord A Coordinator object which keeps track of all threads. after_run View source after_run( run_context, run_values ) Called after each call to run(). The run_values argument contains results of requested ops/tensors by before_run(). The run_context argument is the same one send to before_run call. run_context.request_stop() can be called to stop the iteration. If session.run() raises any exceptions then after_run() is not called. Args run_context A SessionRunContext object. run_values A SessionRunValues object. before_run View source before_run( run_context ) Called before each call to run(). You can return from this call a SessionRunArgs object indicating ops or tensors to add to the upcoming run() call. These ops/tensors will be run together with the ops/tensors originally passed to the original run() call. The run args you return can also contain feeds to be added to the run() call. The run_context argument is a SessionRunContext that provides information about the upcoming run() call: the originally requested op/tensors, the TensorFlow Session. At this point graph is finalized and you can not add ops. Args run_context A SessionRunContext object. Returns None or a SessionRunArgs object. begin View source begin() Called once before using the session. When called, the default graph is the one that will be launched in the session. The hook can modify the graph by adding new operations to it. After the begin() call the graph will be finalized and the other callbacks can not modify the graph anymore. Second call of begin() on the same graph, should not change the graph. end View source end( session ) Called at the end of session. The session argument can be used in case the hook wants to run final ops, such as saving a last checkpoint. If session.run() raises exception other than OutOfRangeError or StopIteration then end() is not called. Note the difference between end() and after_run() behavior when session.run() raises OutOfRangeError or StopIteration. In that case end() is called but after_run() is not called. Args session A TensorFlow Session that will be soon closed.
tensorflow.estimator.nantensorhook
tf.estimator.PoissonRegressionHead View source on GitHub Creates a Head for poisson regression using tf.nn.log_poisson_loss. Inherits From: RegressionHead, Head View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.PoissonRegressionHead tf.estimator.PoissonRegressionHead( label_dimension=1, weight_column=None, loss_reduction=losses_utils.ReductionV2.SUM_OVER_BATCH_SIZE, compute_full_loss=True, name=None ) The loss is the weighted sum over all input dimensions. Namely, if the input labels have shape [batch_size, label_dimension], the loss is the weighted sum over both batch_size and label_dimension. The head expects logits with shape [D0, D1, ... DN, label_dimension]. In many applications, the shape is [batch_size, label_dimension]. The labels shape must match logits, namely [D0, D1, ... DN, label_dimension]. If label_dimension=1, shape [D0, D1, ... DN] is also supported. If weight_column is specified, weights must be of shape [D0, D1, ... DN], [D0, D1, ... DN, 1] or [D0, D1, ... DN, label_dimension]. This is implemented as a generalized linear model, see https://en.wikipedia.org/wiki/Generalized_linear_model The head can be used with a canned estimator. Example: my_head = tf.estimator.PoissonRegressionHead() my_estimator = tf.estimator.DNNEstimator( head=my_head, hidden_units=..., feature_columns=...) It can also be used with a custom model_fn. Example: def _my_model_fn(features, labels, mode): my_head = tf.estimator.PoissonRegressionHead() logits = tf.keras.Model(...)(features) return my_head.create_estimator_spec( features=features, mode=mode, labels=labels, optimizer=tf.keras.optimizers.Adagrad(lr=0.1), logits=logits) my_estimator = tf.estimator.Estimator(model_fn=_my_model_fn) Args weight_column A string or a NumericColumn created by tf.feature_column.numeric_column defining feature column representing weights. It is used to down weight or boost examples during training. It will be multiplied by the loss of the example. label_dimension Number of regression labels per example. This is the size of the last dimension of the labels Tensor (typically, this has shape [batch_size, label_dimension]). loss_reduction One of tf.losses.Reduction except NONE. Decides how to reduce training loss over batch and label dimension. Defaults to SUM_OVER_BATCH_SIZE, namely weighted sum of losses divided by batch size * label_dimension. compute_full_loss Whether to include the constant log(z!) term in computing the poisson loss. See tf.nn.log_poisson_loss for the full documentation. name name of the head. If provided, summary and metrics keys will be suffixed by "/" + name. Also used as name_scope when creating ops. Attributes logits_dimension See base_head.Head for details. loss_reduction See base_head.Head for details. name See base_head.Head for details. Methods create_estimator_spec View source create_estimator_spec( features, mode, logits, labels=None, optimizer=None, trainable_variables=None, train_op_fn=None, update_ops=None, regularization_losses=None ) Returns EstimatorSpec that a model_fn can return. It is recommended to pass all args via name. Args features Input dict mapping string feature names to Tensor or SparseTensor objects containing the values for that feature in a minibatch. Often to be used to fetch example-weight tensor. mode Estimator's ModeKeys. logits Logits Tensor to be used by the head. labels Labels Tensor, or dict mapping string label names to Tensor objects of the label values. optimizer An tf.keras.optimizers.Optimizer instance to optimize the loss in TRAIN mode. Namely, sets train_op = optimizer.get_updates(loss, trainable_variables), which updates variables to minimize loss. trainable_variables A list or tuple of Variable objects to update to minimize loss. In Tensorflow 1.x, by default these are the list of variables collected in the graph under the key GraphKeys.TRAINABLE_VARIABLES. As Tensorflow 2.x doesn't have collections and GraphKeys, trainable_variables need to be passed explicitly here. train_op_fn Function that takes a scalar loss Tensor and returns an op to optimize the model with the loss in TRAIN mode. Used if optimizer is None. Exactly one of train_op_fn and optimizer must be set in TRAIN mode. By default, it is None in other modes. If you want to optimize loss yourself, you can pass lambda _: tf.no_op() and then use EstimatorSpec.loss to compute and apply gradients. update_ops A list or tuple of update ops to be run at training time. For example, layers such as BatchNormalization create mean and variance update ops that need to be run at training time. In Tensorflow 1.x, these are thrown into an UPDATE_OPS collection. As Tensorflow 2.x doesn't have collections, update_ops need to be passed explicitly here. regularization_losses A list of additional scalar losses to be added to the training loss, such as regularization losses. Returns EstimatorSpec. loss View source loss( labels, logits, features=None, mode=None, regularization_losses=None ) Return predictions based on keys. See base_head.Head for details. metrics View source metrics( regularization_losses=None ) Creates metrics. See base_head.Head for details. predictions View source predictions( logits ) Return predictions based on keys. See base_head.Head for details. Args logits logits Tensor with shape [D0, D1, ... DN, logits_dimension]. For many applications, the shape is [batch_size, logits_dimension]. Returns A dict of predictions. update_metrics View source update_metrics( eval_metrics, features, logits, labels, regularization_losses=None ) Updates eval metrics. See base_head.Head for details.
tensorflow.estimator.poissonregressionhead
tf.estimator.ProfilerHook Captures CPU/GPU profiling information every N steps or seconds. Inherits From: SessionRunHook View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.ProfilerHook, tf.compat.v1.train.ProfilerHook tf.estimator.ProfilerHook( save_steps=None, save_secs=None, output_dir='', show_dataflow=True, show_memory=False ) This produces files called "timeline-.json", which are in Chrome Trace format. For more information see: https://github.com/catapult-project/catapult/blob/master/tracing/README.md Args save_steps int, save profile traces every N steps. Exactly one of save_secs and save_steps should be set. save_secs int or float, save profile traces every N seconds. output_dir string, the directory to save the profile traces to. Defaults to the current directory. show_dataflow bool, if True, add flow events to the trace connecting producers and consumers of tensors. show_memory bool, if True, add object snapshot events to the trace showing the sizes and lifetimes of tensors. Methods after_create_session View source after_create_session( session, coord ) Called when new TensorFlow session is created. This is called to signal the hooks that a new session has been created. This has two essential differences with the situation in which begin is called: When this is called, the graph is finalized and ops can no longer be added to the graph. This method will also be called as a result of recovering a wrapped session, not only at the beginning of the overall session. Args session A TensorFlow Session that has been created. coord A Coordinator object which keeps track of all threads. after_run View source after_run( run_context, run_values ) Called after each call to run(). The run_values argument contains results of requested ops/tensors by before_run(). The run_context argument is the same one send to before_run call. run_context.request_stop() can be called to stop the iteration. If session.run() raises any exceptions then after_run() is not called. Args run_context A SessionRunContext object. run_values A SessionRunValues object. before_run View source before_run( run_context ) Called before each call to run(). You can return from this call a SessionRunArgs object indicating ops or tensors to add to the upcoming run() call. These ops/tensors will be run together with the ops/tensors originally passed to the original run() call. The run args you return can also contain feeds to be added to the run() call. The run_context argument is a SessionRunContext that provides information about the upcoming run() call: the originally requested op/tensors, the TensorFlow Session. At this point graph is finalized and you can not add ops. Args run_context A SessionRunContext object. Returns None or a SessionRunArgs object. begin View source begin() Called once before using the session. When called, the default graph is the one that will be launched in the session. The hook can modify the graph by adding new operations to it. After the begin() call the graph will be finalized and the other callbacks can not modify the graph anymore. Second call of begin() on the same graph, should not change the graph. end View source end( session ) Called at the end of session. The session argument can be used in case the hook wants to run final ops, such as saving a last checkpoint. If session.run() raises exception other than OutOfRangeError or StopIteration then end() is not called. Note the difference between end() and after_run() behavior when session.run() raises OutOfRangeError or StopIteration. In that case end() is called but after_run() is not called. Args session A TensorFlow Session that will be soon closed.
tensorflow.estimator.profilerhook
tf.estimator.RegressionHead View source on GitHub Creates a Head for regression using the mean_squared_error loss. Inherits From: Head View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.RegressionHead tf.estimator.RegressionHead( label_dimension=1, weight_column=None, loss_reduction=losses_utils.ReductionV2.SUM_OVER_BATCH_SIZE, loss_fn=None, inverse_link_fn=None, name=None ) The loss is the weighted sum over all input dimensions. Namely, if the input labels have shape [batch_size, label_dimension], the loss is the weighted sum over both batch_size and label_dimension. The head expects logits with shape [D0, D1, ... DN, label_dimension]. In many applications, the shape is [batch_size, label_dimension]. The labels shape must match logits, namely [D0, D1, ... DN, label_dimension]. If label_dimension=1, shape [D0, D1, ... DN] is also supported. If weight_column is specified, weights must be of shape [D0, D1, ... DN], [D0, D1, ... DN, 1] or [D0, D1, ... DN, label_dimension]. Supports custom loss_fn. loss_fn takes (labels, logits) or (labels, logits, features, loss_reduction) as arguments and returns unreduced loss with shape [D0, D1, ... DN, label_dimension]. Also supports custom inverse_link_fn, also known as 'mean function'. inverse_link_fn is only used in PREDICT mode. It takes logits as argument and returns predicted values. This function is the inverse of the link function defined in https://en.wikipedia.org/wiki/Generalized_linear_model#Link_function Namely, for poisson regression, set inverse_link_fn=tf.exp. Usage: head = tf.estimator.RegressionHead() logits = np.array(((45,), (41,),), dtype=np.float32) labels = np.array(((43,), (44,),), dtype=np.int32) features = {'x': np.array(((42,),), dtype=np.float32)} # expected_loss = weighted_loss / batch_size # = (43-45)^2 + (44-41)^2 / 2 = 6.50 loss = head.loss(labels, logits, features=features) print('{:.2f}'.format(loss.numpy())) 6.50 eval_metrics = head.metrics() updated_metrics = head.update_metrics( eval_metrics, features, logits, labels) for k in sorted(updated_metrics): print('{} : {:.2f}'.format(k, updated_metrics[k].result().numpy())) average_loss : 6.50 label/mean : 43.50 prediction/mean : 43.00 preds = head.predictions(logits) print(preds['predictions']) tf.Tensor( [[45.] [41.]], shape=(2, 1), dtype=float32) Usage with a canned estimator: my_head = tf.estimator.RegressionHead() my_estimator = tf.estimator.DNNEstimator( head=my_head, hidden_units=..., feature_columns=...) It can also be used with a custom model_fn. Example: def _my_model_fn(features, labels, mode): my_head = tf.estimator.RegressionHead() logits = tf.keras.Model(...)(features) return my_head.create_estimator_spec( features=features, mode=mode, labels=labels, optimizer=tf.keras.optimizers.Adagrad(lr=0.1), logits=logits) my_estimator = tf.estimator.Estimator(model_fn=_my_model_fn) Args weight_column A string or a NumericColumn created by tf.feature_column.numeric_column defining feature column representing weights. It is used to down weight or boost examples during training. It will be multiplied by the loss of the example. label_dimension Number of regression labels per example. This is the size of the last dimension of the labels Tensor (typically, this has shape [batch_size, label_dimension]). loss_reduction One of tf.losses.Reduction except NONE. Decides how to reduce training loss over batch and label dimension. Defaults to SUM_OVER_BATCH_SIZE, namely weighted sum of losses divided by batch_size * label_dimension. loss_fn Optional loss function. Defaults to mean_squared_error. inverse_link_fn Optional inverse link function, also known as 'mean function'. Defaults to identity. name name of the head. If provided, summary and metrics keys will be suffixed by "/" + name. Also used as name_scope when creating ops. Attributes logits_dimension See base_head.Head for details. loss_reduction See base_head.Head for details. name See base_head.Head for details. Methods create_estimator_spec View source create_estimator_spec( features, mode, logits, labels=None, optimizer=None, trainable_variables=None, train_op_fn=None, update_ops=None, regularization_losses=None ) Returns EstimatorSpec that a model_fn can return. It is recommended to pass all args via name. Args features Input dict mapping string feature names to Tensor or SparseTensor objects containing the values for that feature in a minibatch. Often to be used to fetch example-weight tensor. mode Estimator's ModeKeys. logits Logits Tensor to be used by the head. labels Labels Tensor, or dict mapping string label names to Tensor objects of the label values. optimizer An tf.keras.optimizers.Optimizer instance to optimize the loss in TRAIN mode. Namely, sets train_op = optimizer.get_updates(loss, trainable_variables), which updates variables to minimize loss. trainable_variables A list or tuple of Variable objects to update to minimize loss. In Tensorflow 1.x, by default these are the list of variables collected in the graph under the key GraphKeys.TRAINABLE_VARIABLES. As Tensorflow 2.x doesn't have collections and GraphKeys, trainable_variables need to be passed explicitly here. train_op_fn Function that takes a scalar loss Tensor and returns an op to optimize the model with the loss in TRAIN mode. Used if optimizer is None. Exactly one of train_op_fn and optimizer must be set in TRAIN mode. By default, it is None in other modes. If you want to optimize loss yourself, you can pass lambda _: tf.no_op() and then use EstimatorSpec.loss to compute and apply gradients. update_ops A list or tuple of update ops to be run at training time. For example, layers such as BatchNormalization create mean and variance update ops that need to be run at training time. In Tensorflow 1.x, these are thrown into an UPDATE_OPS collection. As Tensorflow 2.x doesn't have collections, update_ops need to be passed explicitly here. regularization_losses A list of additional scalar losses to be added to the training loss, such as regularization losses. Returns EstimatorSpec. loss View source loss( labels, logits, features=None, mode=None, regularization_losses=None ) Return predictions based on keys. See base_head.Head for details. metrics View source metrics( regularization_losses=None ) Creates metrics. See base_head.Head for details. predictions View source predictions( logits ) Return predictions based on keys. See base_head.Head for details. Args logits logits Tensor with shape [D0, D1, ... DN, logits_dimension]. For many applications, the shape is [batch_size, logits_dimension]. Returns A dict of predictions. update_metrics View source update_metrics( eval_metrics, features, logits, labels, regularization_losses=None ) Updates eval metrics. See base_head.Head for details.
tensorflow.estimator.regressionhead
tf.estimator.regressor_parse_example_spec View source on GitHub Generates parsing spec for tf.parse_example to be used with regressors. tf.estimator.regressor_parse_example_spec( feature_columns, label_key, label_dtype=tf.dtypes.float32, label_default=None, label_dimension=1, weight_column=None ) If users keep data in tf.Example format, they need to call tf.parse_example with a proper feature spec. There are two main things that this utility helps: Users need to combine parsing spec of features with labels and weights (if any) since they are all parsed from same tf.Example instance. This utility combines these specs. It is difficult to map expected label by a regressor such as DNNRegressor to corresponding tf.parse_example spec. This utility encodes it by getting related information from users (key, dtype). Example output of parsing spec: # Define features and transformations feature_b = tf.feature_column.numeric_column(...) feature_c_bucketized = tf.feature_column.bucketized_column( tf.feature_column.numeric_column("feature_c"), ...) feature_a_x_feature_c = tf.feature_column.crossed_column( columns=["feature_a", feature_c_bucketized], ...) feature_columns = [feature_b, feature_c_bucketized, feature_a_x_feature_c] parsing_spec = tf.estimator.regressor_parse_example_spec( feature_columns, label_key='my-label') # For the above example, regressor_parse_example_spec would return the dict: assert parsing_spec == { "feature_a": parsing_ops.VarLenFeature(tf.string), "feature_b": parsing_ops.FixedLenFeature([1], dtype=tf.float32), "feature_c": parsing_ops.FixedLenFeature([1], dtype=tf.float32) "my-label" : parsing_ops.FixedLenFeature([1], dtype=tf.float32) } Example usage with a regressor: feature_columns = # define features via tf.feature_column estimator = DNNRegressor( hidden_units=[256, 64, 16], feature_columns=feature_columns, weight_column='example-weight', label_dimension=3) # This label configuration tells the regressor the following: # * weights are retrieved with key 'example-weight' # * label is a 3 dimension tensor with float32 dtype. # Input builders def input_fn_train(): # Returns a tuple of features and labels. features = tf.contrib.learn.read_keyed_batch_features( file_pattern=train_files, batch_size=batch_size, # creates parsing configuration for tf.parse_example features=tf.estimator.classifier_parse_example_spec( feature_columns, label_key='my-label', label_dimension=3, weight_column='example-weight'), reader=tf.RecordIOReader) labels = features.pop('my-label') return features, labels estimator.train(input_fn=input_fn_train) Args feature_columns An iterable containing all feature columns. All items should be instances of classes derived from _FeatureColumn. label_key A string identifying the label. It means tf.Example stores labels with this key. label_dtype A tf.dtype identifies the type of labels. By default it is tf.float32. label_default used as label if label_key does not exist in given tf.Example. By default default_value is none, which means tf.parse_example will error out if there is any missing label. label_dimension Number of regression targets per example. This is the size of the last dimension of the labels and logits Tensor objects (typically, these have shape [batch_size, label_dimension]). weight_column A string or a NumericColumn created by tf.feature_column.numeric_column defining feature column representing weights. It is used to down weight or boost examples during training. It will be multiplied by the loss of the example. If it is a string, it is used as a key to fetch weight tensor from the features. If it is a NumericColumn, raw tensor is fetched by key weight_column.key, then weight_column.normalizer_fn is applied on it to get weight tensor. Returns A dict mapping each feature key to a FixedLenFeature or VarLenFeature value. Raises ValueError If label is used in feature_columns. ValueError If weight_column is used in feature_columns. ValueError If any of the given feature_columns is not a _FeatureColumn instance. ValueError If weight_column is not a NumericColumn instance. ValueError if label_key is None.
tensorflow.estimator.regressor_parse_example_spec
tf.estimator.RunConfig View source on GitHub This class specifies the configurations for an Estimator run. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.RunConfig tf.estimator.RunConfig( model_dir=None, tf_random_seed=None, save_summary_steps=100, save_checkpoints_steps=_USE_DEFAULT, save_checkpoints_secs=_USE_DEFAULT, session_config=None, keep_checkpoint_max=5, keep_checkpoint_every_n_hours=10000, log_step_count_steps=100, train_distribute=None, device_fn=None, protocol=None, eval_distribute=None, experimental_distribute=None, experimental_max_worker_delay_secs=None, session_creation_timeout_secs=7200, checkpoint_save_graph_def=True ) Args model_dir directory where model parameters, graph, etc are saved. If PathLike object, the path will be resolved. If None, will use a default value set by the Estimator. tf_random_seed Random seed for TensorFlow initializers. Setting this value allows consistency between reruns. save_summary_steps Save summaries every this many steps. save_checkpoints_steps Save checkpoints every this many steps. Can not be specified with save_checkpoints_secs. save_checkpoints_secs Save checkpoints every this many seconds. Can not be specified with save_checkpoints_steps. Defaults to 600 seconds if both save_checkpoints_steps and save_checkpoints_secs are not set in constructor. If both save_checkpoints_steps and save_checkpoints_secs are None, then checkpoints are disabled. session_config a ConfigProto used to set session parameters, or None. keep_checkpoint_max The maximum number of recent checkpoint files to keep. As new files are created, older files are deleted. If None or 0, all checkpoint files are kept. Defaults to 5 (that is, the 5 most recent checkpoint files are kept). If a saver is passed to the estimator, this argument will be ignored. keep_checkpoint_every_n_hours Number of hours between each checkpoint to be saved. The default value of 10,000 hours effectively disables the feature. log_step_count_steps The frequency, in number of global steps, that the global step and the loss will be logged during training. Also controls the frequency that the global steps / s will be logged (and written to summary) during training. train_distribute An optional instance of tf.distribute.Strategy. If specified, then Estimator will distribute the user's model during training, according to the policy specified by that strategy. Setting experimental_distribute.train_distribute is preferred. device_fn A callable invoked for every Operation that takes the Operation and returns the device string. If None, defaults to the device function returned by tf.train.replica_device_setter with round-robin strategy. protocol An optional argument which specifies the protocol used when starting server. None means default to grpc. eval_distribute An optional instance of tf.distribute.Strategy. If specified, then Estimator will distribute the user's model during evaluation, according to the policy specified by that strategy. Setting experimental_distribute.eval_distribute is preferred. experimental_distribute An optional tf.contrib.distribute.DistributeConfig object specifying DistributionStrategy-related configuration. The train_distribute and eval_distribute can be passed as parameters to RunConfig or set in experimental_distribute but not both. experimental_max_worker_delay_secs An optional integer specifying the maximum time a worker should wait before starting. By default, workers are started at staggered times, with each worker being delayed by up to 60 seconds. This is intended to reduce the risk of divergence, which can occur when many workers simultaneously update the weights of a randomly initialized model. Users who warm-start their models and train them for short durations (a few minutes or less) should consider reducing this default to improve training times. session_creation_timeout_secs Max time workers should wait for a session to become available (on initialization or when recovering a session) with MonitoredTrainingSession. Defaults to 7200 seconds, but users may want to set a lower value to detect problems with variable / session (re)-initialization more quickly. checkpoint_save_graph_def Whether to save the GraphDef and MetaGraphDef to checkpoint_dir. The GraphDef is saved after the session is created as graph.pbtxt. MetaGraphDefs are saved out for every checkpoint as model.ckpt-*.meta. Raises ValueError If both save_checkpoints_steps and save_checkpoints_secs are set. Attributes checkpoint_save_graph_def cluster_spec device_fn Returns the device_fn. If device_fn is not None, it overrides the default device function used in Estimator. Otherwise the default one is used. eval_distribute Optional tf.distribute.Strategy for evaluation. evaluation_master experimental_max_worker_delay_secs global_id_in_cluster The global id in the training cluster. All global ids in the training cluster are assigned from an increasing sequence of consecutive integers. The first id is 0. Note: Task id (the property field task_id) is tracking the index of the node among all nodes with the SAME task type. For example, given the cluster definition as follows: cluster = {'chief': ['host0:2222'], 'ps': ['host1:2222', 'host2:2222'], 'worker': ['host3:2222', 'host4:2222', 'host5:2222']} Nodes with task type worker can have id 0, 1, 2. Nodes with task type ps can have id, 0, 1. So, task_id is not unique, but the pair (task_type, task_id) can uniquely determine a node in the cluster. Global id, i.e., this field, is tracking the index of the node among ALL nodes in the cluster. It is uniquely assigned. For example, for the cluster spec given above, the global ids are assigned as: task_type | task_id | global_id -------------------------------- chief | 0 | 0 worker | 0 | 1 worker | 1 | 2 worker | 2 | 3 ps | 0 | 4 ps | 1 | 5 is_chief keep_checkpoint_every_n_hours keep_checkpoint_max log_step_count_steps master model_dir num_ps_replicas num_worker_replicas protocol Returns the optional protocol value. save_checkpoints_secs save_checkpoints_steps save_summary_steps service Returns the platform defined (in TF_CONFIG) service dict. session_config session_creation_timeout_secs task_id task_type tf_random_seed train_distribute Optional tf.distribute.Strategy for training. Methods replace View source replace( **kwargs ) Returns a new instance of RunConfig replacing specified properties. Only the properties in the following list are allowed to be replaced: model_dir, tf_random_seed, save_summary_steps, save_checkpoints_steps, save_checkpoints_secs, session_config, keep_checkpoint_max, keep_checkpoint_every_n_hours, log_step_count_steps, train_distribute, device_fn, protocol. eval_distribute, experimental_distribute, experimental_max_worker_delay_secs, In addition, either save_checkpoints_steps or save_checkpoints_secs can be set (should not be both). Args **kwargs keyword named properties with new values. Raises ValueError If any property name in kwargs does not exist or is not allowed to be replaced, or both save_checkpoints_steps and save_checkpoints_secs are set. Returns a new instance of RunConfig.
tensorflow.estimator.runconfig
tf.estimator.SecondOrStepTimer Timer that triggers at most once every N seconds or once every N steps. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.SecondOrStepTimer, tf.compat.v1.train.SecondOrStepTimer tf.estimator.SecondOrStepTimer( every_secs=None, every_steps=None ) This symbol is also exported to v2 in tf.estimator namespace. See https://github.com/tensorflow/estimator/blob/master/tensorflow_estimator/python/estimator/hooks/basic_session_run_hooks.py Methods last_triggered_step View source last_triggered_step() Returns the last triggered time step or None if never triggered. reset View source reset() Resets the timer. should_trigger_for_step View source should_trigger_for_step( step ) Return true if the timer should trigger for the specified step. Args step Training step to trigger on. Returns True if the difference between the current time and the time of the last trigger exceeds every_secs, or if the difference between the current step and the last triggered step exceeds every_steps. False otherwise. update_last_triggered_step View source update_last_triggered_step( step ) Update the last triggered time and step number. Args step The current step. Returns A pair (elapsed_time, elapsed_steps), where elapsed_time is the number of seconds between the current trigger and the last one (a float), and elapsed_steps is the number of steps between the current trigger and the last one. Both values will be set to None on the first trigger.
tensorflow.estimator.secondorsteptimer
tf.estimator.SessionRunArgs Represents arguments to be added to a Session.run() call. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.SessionRunArgs, tf.compat.v1.train.SessionRunArgs tf.estimator.SessionRunArgs( fetches, feed_dict=None, options=None ) Args fetches Exactly like the 'fetches' argument to Session.Run(). Can be a single tensor or op, a list of 'fetches' or a dictionary of fetches. For example: fetches = global_step_tensor fetches = [train_op, summary_op, global_step_tensor] fetches = {'step': global_step_tensor, 'summ': summary_op} Note that this can recurse as expected: fetches = {'step': global_step_tensor, 'ops': [train_op, check_nan_op]} feed_dict Exactly like the feed_dict argument to Session.Run() options Exactly like the options argument to Session.run(), i.e., a config_pb2.RunOptions proto. Attributes fetches feed_dict options
tensorflow.estimator.sessionrunargs
tf.estimator.SessionRunContext Provides information about the session.run() call being made. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.SessionRunContext, tf.compat.v1.train.SessionRunContext tf.estimator.SessionRunContext( original_args, session ) Provides information about original request to Session.Run() function. SessionRunHook objects can stop the loop by calling request_stop() of run_context. In the future we may use this object to add more information about run without changing the Hook API. Attributes original_args A SessionRunArgs object holding the original arguments of run(). If user called MonitoredSession.run(fetches=a, feed_dict=b), then this field is equal to SessionRunArgs(a, b). session A TensorFlow session object which will execute the run. stop_requested Returns whether a stop is requested or not. If true, MonitoredSession stops iterations. Returns: A bool Methods request_stop View source request_stop() Sets stop requested field. Hooks can use this function to request stop of iterations. MonitoredSession checks whether this is called or not.
tensorflow.estimator.sessionruncontext
tf.estimator.SessionRunHook Hook to extend calls to MonitoredSession.run(). View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.SessionRunHook, tf.compat.v1.train.SessionRunHook Methods after_create_session View source after_create_session( session, coord ) Called when new TensorFlow session is created. This is called to signal the hooks that a new session has been created. This has two essential differences with the situation in which begin is called: When this is called, the graph is finalized and ops can no longer be added to the graph. This method will also be called as a result of recovering a wrapped session, not only at the beginning of the overall session. Args session A TensorFlow Session that has been created. coord A Coordinator object which keeps track of all threads. after_run View source after_run( run_context, run_values ) Called after each call to run(). The run_values argument contains results of requested ops/tensors by before_run(). The run_context argument is the same one send to before_run call. run_context.request_stop() can be called to stop the iteration. If session.run() raises any exceptions then after_run() is not called. Args run_context A SessionRunContext object. run_values A SessionRunValues object. before_run View source before_run( run_context ) Called before each call to run(). You can return from this call a SessionRunArgs object indicating ops or tensors to add to the upcoming run() call. These ops/tensors will be run together with the ops/tensors originally passed to the original run() call. The run args you return can also contain feeds to be added to the run() call. The run_context argument is a SessionRunContext that provides information about the upcoming run() call: the originally requested op/tensors, the TensorFlow Session. At this point graph is finalized and you can not add ops. Args run_context A SessionRunContext object. Returns None or a SessionRunArgs object. begin View source begin() Called once before using the session. When called, the default graph is the one that will be launched in the session. The hook can modify the graph by adding new operations to it. After the begin() call the graph will be finalized and the other callbacks can not modify the graph anymore. Second call of begin() on the same graph, should not change the graph. end View source end( session ) Called at the end of session. The session argument can be used in case the hook wants to run final ops, such as saving a last checkpoint. If session.run() raises exception other than OutOfRangeError or StopIteration then end() is not called. Note the difference between end() and after_run() behavior when session.run() raises OutOfRangeError or StopIteration. In that case end() is called but after_run() is not called. Args session A TensorFlow Session that will be soon closed.
tensorflow.estimator.sessionrunhook
tf.estimator.SessionRunValues Contains the results of Session.run(). View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.SessionRunValues, tf.compat.v1.train.SessionRunValues tf.estimator.SessionRunValues( results, options, run_metadata ) In the future we may use this object to add more information about result of run without changing the Hook API. Args results The return values from Session.run() corresponding to the fetches attribute returned in the RunArgs. Note that this has the same shape as the RunArgs fetches. For example: fetches = global_step_tensor => results = nparray(int) fetches = [train_op, summary_op, global_step_tensor] => results = [None, nparray(string), nparray(int)] fetches = {'step': global_step_tensor, 'summ': summary_op} => results = {'step': nparray(int), 'summ': nparray(string)} options RunOptions from the Session.run() call. run_metadata RunMetadata from the Session.run() call. Attributes results options run_metadata
tensorflow.estimator.sessionrunvalues
tf.estimator.StepCounterHook Hook that counts steps per second. Inherits From: SessionRunHook View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.StepCounterHook, tf.compat.v1.train.StepCounterHook tf.estimator.StepCounterHook( every_n_steps=100, every_n_secs=None, output_dir=None, summary_writer=None ) Methods after_create_session View source after_create_session( session, coord ) Called when new TensorFlow session is created. This is called to signal the hooks that a new session has been created. This has two essential differences with the situation in which begin is called: When this is called, the graph is finalized and ops can no longer be added to the graph. This method will also be called as a result of recovering a wrapped session, not only at the beginning of the overall session. Args session A TensorFlow Session that has been created. coord A Coordinator object which keeps track of all threads. after_run View source after_run( run_context, run_values ) Called after each call to run(). The run_values argument contains results of requested ops/tensors by before_run(). The run_context argument is the same one send to before_run call. run_context.request_stop() can be called to stop the iteration. If session.run() raises any exceptions then after_run() is not called. Args run_context A SessionRunContext object. run_values A SessionRunValues object. before_run View source before_run( run_context ) Called before each call to run(). You can return from this call a SessionRunArgs object indicating ops or tensors to add to the upcoming run() call. These ops/tensors will be run together with the ops/tensors originally passed to the original run() call. The run args you return can also contain feeds to be added to the run() call. The run_context argument is a SessionRunContext that provides information about the upcoming run() call: the originally requested op/tensors, the TensorFlow Session. At this point graph is finalized and you can not add ops. Args run_context A SessionRunContext object. Returns None or a SessionRunArgs object. begin View source begin() Called once before using the session. When called, the default graph is the one that will be launched in the session. The hook can modify the graph by adding new operations to it. After the begin() call the graph will be finalized and the other callbacks can not modify the graph anymore. Second call of begin() on the same graph, should not change the graph. end View source end( session ) Called at the end of session. The session argument can be used in case the hook wants to run final ops, such as saving a last checkpoint. If session.run() raises exception other than OutOfRangeError or StopIteration then end() is not called. Note the difference between end() and after_run() behavior when session.run() raises OutOfRangeError or StopIteration. In that case end() is called but after_run() is not called. Args session A TensorFlow Session that will be soon closed.
tensorflow.estimator.stepcounterhook
tf.estimator.StopAtStepHook Hook that requests stop at a specified step. Inherits From: SessionRunHook View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.StopAtStepHook, tf.compat.v1.train.StopAtStepHook tf.estimator.StopAtStepHook( num_steps=None, last_step=None ) Args num_steps Number of steps to execute. last_step Step after which to stop. Raises ValueError If one of the arguments is invalid. Methods after_create_session View source after_create_session( session, coord ) Called when new TensorFlow session is created. This is called to signal the hooks that a new session has been created. This has two essential differences with the situation in which begin is called: When this is called, the graph is finalized and ops can no longer be added to the graph. This method will also be called as a result of recovering a wrapped session, not only at the beginning of the overall session. Args session A TensorFlow Session that has been created. coord A Coordinator object which keeps track of all threads. after_run View source after_run( run_context, run_values ) Called after each call to run(). The run_values argument contains results of requested ops/tensors by before_run(). The run_context argument is the same one send to before_run call. run_context.request_stop() can be called to stop the iteration. If session.run() raises any exceptions then after_run() is not called. Args run_context A SessionRunContext object. run_values A SessionRunValues object. before_run View source before_run( run_context ) Called before each call to run(). You can return from this call a SessionRunArgs object indicating ops or tensors to add to the upcoming run() call. These ops/tensors will be run together with the ops/tensors originally passed to the original run() call. The run args you return can also contain feeds to be added to the run() call. The run_context argument is a SessionRunContext that provides information about the upcoming run() call: the originally requested op/tensors, the TensorFlow Session. At this point graph is finalized and you can not add ops. Args run_context A SessionRunContext object. Returns None or a SessionRunArgs object. begin View source begin() Called once before using the session. When called, the default graph is the one that will be launched in the session. The hook can modify the graph by adding new operations to it. After the begin() call the graph will be finalized and the other callbacks can not modify the graph anymore. Second call of begin() on the same graph, should not change the graph. end View source end( session ) Called at the end of session. The session argument can be used in case the hook wants to run final ops, such as saving a last checkpoint. If session.run() raises exception other than OutOfRangeError or StopIteration then end() is not called. Note the difference between end() and after_run() behavior when session.run() raises OutOfRangeError or StopIteration. In that case end() is called but after_run() is not called. Args session A TensorFlow Session that will be soon closed.
tensorflow.estimator.stopatstephook
tf.estimator.SummarySaverHook Saves summaries every N steps. Inherits From: SessionRunHook View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.SummarySaverHook, tf.compat.v1.train.SummarySaverHook tf.estimator.SummarySaverHook( save_steps=None, save_secs=None, output_dir=None, summary_writer=None, scaffold=None, summary_op=None ) Args save_steps int, save summaries every N steps. Exactly one of save_secs and save_steps should be set. save_secs int, save summaries every N seconds. output_dir string, the directory to save the summaries to. Only used if no summary_writer is supplied. summary_writer SummaryWriter. If None and an output_dir was passed, one will be created accordingly. scaffold Scaffold to get summary_op if it's not provided. summary_op Tensor of type string containing the serialized Summary protocol buffer or a list of Tensor. They are most likely an output by TF summary methods like tf.compat.v1.summary.scalar or tf.compat.v1.summary.merge_all. It can be passed in as one tensor; if more than one, they must be passed in as a list. Raises ValueError Exactly one of scaffold or summary_op should be set. Methods after_create_session View source after_create_session( session, coord ) Called when new TensorFlow session is created. This is called to signal the hooks that a new session has been created. This has two essential differences with the situation in which begin is called: When this is called, the graph is finalized and ops can no longer be added to the graph. This method will also be called as a result of recovering a wrapped session, not only at the beginning of the overall session. Args session A TensorFlow Session that has been created. coord A Coordinator object which keeps track of all threads. after_run View source after_run( run_context, run_values ) Called after each call to run(). The run_values argument contains results of requested ops/tensors by before_run(). The run_context argument is the same one send to before_run call. run_context.request_stop() can be called to stop the iteration. If session.run() raises any exceptions then after_run() is not called. Args run_context A SessionRunContext object. run_values A SessionRunValues object. before_run View source before_run( run_context ) Called before each call to run(). You can return from this call a SessionRunArgs object indicating ops or tensors to add to the upcoming run() call. These ops/tensors will be run together with the ops/tensors originally passed to the original run() call. The run args you return can also contain feeds to be added to the run() call. The run_context argument is a SessionRunContext that provides information about the upcoming run() call: the originally requested op/tensors, the TensorFlow Session. At this point graph is finalized and you can not add ops. Args run_context A SessionRunContext object. Returns None or a SessionRunArgs object. begin View source begin() Called once before using the session. When called, the default graph is the one that will be launched in the session. The hook can modify the graph by adding new operations to it. After the begin() call the graph will be finalized and the other callbacks can not modify the graph anymore. Second call of begin() on the same graph, should not change the graph. end View source end( session=None ) Called at the end of session. The session argument can be used in case the hook wants to run final ops, such as saving a last checkpoint. If session.run() raises exception other than OutOfRangeError or StopIteration then end() is not called. Note the difference between end() and after_run() behavior when session.run() raises OutOfRangeError or StopIteration. In that case end() is called but after_run() is not called. Args session A TensorFlow Session that will be soon closed.
tensorflow.estimator.summarysaverhook
tf.estimator.TrainSpec View source on GitHub Configuration for the "train" part for the train_and_evaluate call. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.TrainSpec tf.estimator.TrainSpec( input_fn, max_steps=None, hooks=None, saving_listeners=None ) TrainSpec determines the input data for the training, as well as the duration. Optional hooks run at various stages of training. Usage: train_spec = tf.estimator.TrainSpec( input_fn=lambda: 1, max_steps=100, hooks=[_StopAtSecsHook(stop_after_secs=10)], saving_listeners=[_NewCheckpointListenerForEvaluate(None, 20, None)]) train_spec.saving_listeners[0]._eval_throttle_secs 20 train_spec.hooks[0]._stop_after_secs 10 train_spec.max_steps 100 Args input_fn A function that provides input data for training as minibatches. See Premade Estimators for more information. The function should construct and return one of the following: A 'tf.data.Dataset' object: Outputs of Dataset object must be a tuple (features, labels) with same constraints as below. A tuple (features, labels): Where features is a Tensor or a dictionary of string feature name to Tensor and labels is a Tensor or a dictionary of string label name to Tensor. max_steps Int. Positive number of total steps for which to train model. If None, train forever. The training input_fn is not expected to generate OutOfRangeError or StopIteration exceptions. See the train_and_evaluate stop condition section for details. hooks Iterable of tf.train.SessionRunHook objects to run on all workers (including chief) during training. saving_listeners Iterable of tf.estimator.CheckpointSaverListener objects to run on chief during training. Raises ValueError If any of the input arguments is invalid. TypeError If any of the arguments is not of the expected type. Attributes input_fn max_steps hooks saving_listeners
tensorflow.estimator.trainspec
tf.estimator.train_and_evaluate View source on GitHub Train and evaluate the estimator. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.train_and_evaluate tf.estimator.train_and_evaluate( estimator, train_spec, eval_spec ) This utility function trains, evaluates, and (optionally) exports the model by using the given estimator. All training related specification is held in train_spec, including training input_fn and training max steps, etc. All evaluation and export related specification is held in eval_spec, including evaluation input_fn, steps, etc. This utility function provides consistent behavior for both local (non-distributed) and distributed configurations. The default distribution configuration is parameter server-based between-graph replication. For other types of distribution configurations such as all-reduce training, please use DistributionStrategies. Overfitting: In order to avoid overfitting, it is recommended to set up the training input_fn to shuffle the training data properly. Stop condition: In order to support both distributed and non-distributed configuration reliably, the only supported stop condition for model training is train_spec.max_steps. If train_spec.max_steps is None, the model is trained forever. Use with care if model stop condition is different. For example, assume that the model is expected to be trained with one epoch of training data, and the training input_fn is configured to throw OutOfRangeError after going through one epoch, which stops the Estimator.train. For a three-training-worker distributed configuration, each training worker is likely to go through the whole epoch independently. So, the model will be trained with three epochs of training data instead of one epoch. Example of local (non-distributed) training: # Set up feature columns. categorial_feature_a = categorial_column_with_hash_bucket(...) categorial_feature_a_emb = embedding_column( categorical_column=categorial_feature_a, ...) ... # other feature columns estimator = DNNClassifier( feature_columns=[categorial_feature_a_emb, ...], hidden_units=[1024, 512, 256]) # Or set up the model directory # estimator = DNNClassifier( # config=tf.estimator.RunConfig( # model_dir='/my_model', save_summary_steps=100), # feature_columns=[categorial_feature_a_emb, ...], # hidden_units=[1024, 512, 256]) # Input pipeline for train and evaluate. def train_input_fn(): # returns x, y # please shuffle the data. pass def eval_input_fn(): # returns x, y pass train_spec = tf.estimator.TrainSpec(input_fn=train_input_fn, max_steps=1000) eval_spec = tf.estimator.EvalSpec(input_fn=eval_input_fn) tf.estimator.train_and_evaluate(estimator, train_spec, eval_spec) Note that in current implementation estimator.evaluate will be called multiple times. This means that evaluation graph (including eval_input_fn) will be re-created for each evaluate call. estimator.train will be called only once. Example of distributed training: Regarding the example of distributed training, the code above can be used without a change (Please do make sure that the RunConfig.model_dir for all workers is set to the same directory, i.e., a shared file system all workers can read and write). The only extra work to do is setting the environment variable TF_CONFIG properly for each worker correspondingly. Also see Distributed TensorFlow. Setting environment variable depends on the platform. For example, on Linux, it can be done as follows ($ is the shell prompt): $ TF_CONFIG='<replace_with_real_content>' python train_model.py For the content in TF_CONFIG, assume that the training cluster spec looks like: cluster = {"chief": ["host0:2222"], "worker": ["host1:2222", "host2:2222", "host3:2222"], "ps": ["host4:2222", "host5:2222"]} Example of TF_CONFIG for chief training worker (must have one and only one): # This should be a JSON string, which is set as environment variable. Usually # the cluster manager handles that. TF_CONFIG='{ "cluster": { "chief": ["host0:2222"], "worker": ["host1:2222", "host2:2222", "host3:2222"], "ps": ["host4:2222", "host5:2222"] }, "task": {"type": "chief", "index": 0} }' Note that the chief worker also does the model training job, similar to other non-chief training workers (see next paragraph). In addition to the model training, it manages some extra work, e.g., checkpoint saving and restoring, writing summaries, etc. Example of TF_CONFIG for non-chief training worker (optional, could be multiple): # This should be a JSON string, which is set as environment variable. Usually # the cluster manager handles that. TF_CONFIG='{ "cluster": { "chief": ["host0:2222"], "worker": ["host1:2222", "host2:2222", "host3:2222"], "ps": ["host4:2222", "host5:2222"] }, "task": {"type": "worker", "index": 0} }' where the task.index should be set as 0, 1, 2, in this example, respectively for non-chief training workers. Example of TF_CONFIG for parameter server, aka ps (could be multiple): # This should be a JSON string, which is set as environment variable. Usually # the cluster manager handles that. TF_CONFIG='{ "cluster": { "chief": ["host0:2222"], "worker": ["host1:2222", "host2:2222", "host3:2222"], "ps": ["host4:2222", "host5:2222"] }, "task": {"type": "ps", "index": 0} }' where the task.index should be set as 0 and 1, in this example, respectively for parameter servers. Example of TF_CONFIG for evaluator task. Evaluator is a special task that is not part of the training cluster. There could be only one. It is used for model evaluation. # This should be a JSON string, which is set as environment variable. Usually # the cluster manager handles that. TF_CONFIG='{ "cluster": { "chief": ["host0:2222"], "worker": ["host1:2222", "host2:2222", "host3:2222"], "ps": ["host4:2222", "host5:2222"] }, "task": {"type": "evaluator", "index": 0} }' When distribute or experimental_distribute.train_distribute and experimental_distribute.remote_cluster is set, this method will start a client running on the current host which connects to the remote_cluster for training and evaluation. Args estimator An Estimator instance to train and evaluate. train_spec A TrainSpec instance to specify the training specification. eval_spec A EvalSpec instance to specify the evaluation and export specification. Returns A tuple of the result of the evaluate call to the Estimator and the export results using the specified Exporters. Currently, the return value is undefined for distributed training mode. Raises ValueError if environment variable TF_CONFIG is incorrectly set.
tensorflow.estimator.train_and_evaluate
tf.estimator.VocabInfo Vocabulary information for warm-starting. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.VocabInfo, tf.compat.v1.train.VocabInfo tf.estimator.VocabInfo( new_vocab, new_vocab_size, num_oov_buckets, old_vocab, old_vocab_size=-1, backup_initializer=None, axis=0 ) See tf.estimator.WarmStartSettings for examples of using VocabInfo to warm-start. Args: new_vocab: [Required] A path to the new vocabulary file (used with the model to be trained). new_vocab_size: [Required] An integer indicating how many entries of the new vocabulary will used in training. num_oov_buckets: [Required] An integer indicating how many OOV buckets are associated with the vocabulary. old_vocab: [Required] A path to the old vocabulary file (used with the checkpoint to be warm-started from). old_vocab_size: [Optional] An integer indicating how many entries of the old vocabulary were used in the creation of the checkpoint. If not provided, the entire old vocabulary will be used. backup_initializer: [Optional] A variable initializer used for variables corresponding to new vocabulary entries and OOV. If not provided, these entries will be zero-initialized. axis: [Optional] Denotes what axis the vocabulary corresponds to. The default, 0, corresponds to the most common use case (embeddings or linear weights for binary classification / regression). An axis of 1 could be used for warm-starting output layers with class vocabularies. Returns: A VocabInfo which represents the vocabulary information for warm-starting. Raises: ValueError: axis is neither 0 or 1. Example Usage: embeddings_vocab_info = tf.VocabInfo( new_vocab='embeddings_vocab', new_vocab_size=100, num_oov_buckets=1, old_vocab='pretrained_embeddings_vocab', old_vocab_size=10000, backup_initializer=tf.compat.v1.truncated_normal_initializer( mean=0.0, stddev=(1 / math.sqrt(embedding_dim))), axis=0) softmax_output_layer_kernel_vocab_info = tf.VocabInfo( new_vocab='class_vocab', new_vocab_size=5, num_oov_buckets=0, # No OOV for classes. old_vocab='old_class_vocab', old_vocab_size=8, backup_initializer=tf.compat.v1.glorot_uniform_initializer(), axis=1) softmax_output_layer_bias_vocab_info = tf.VocabInfo( new_vocab='class_vocab', new_vocab_size=5, num_oov_buckets=0, # No OOV for classes. old_vocab='old_class_vocab', old_vocab_size=8, backup_initializer=tf.compat.v1.zeros_initializer(), axis=0) #Currently, only axis=0 and axis=1 are supported. ``` <!-- Tabular view --> <table class="responsive fixed orange"> <colgroup><col width="214px"><col></colgroup> <tr><th colspan="2"><h2 class="add-link">Attributes</h2></th></tr> <tr> <td> `new_vocab` </td> <td> </td> </tr><tr> <td> `new_vocab_size` </td> <td> </td> </tr><tr> <td> `num_oov_buckets` </td> <td> </td> </tr><tr> <td> `old_vocab` </td> <td> </td> </tr><tr> <td> `old_vocab_size` </td> <td> </td> </tr><tr> <td> `backup_initializer` </td> <td> </td> </tr><tr> <td> `axis` </td> <td> </td> </tr> </table>
tensorflow.estimator.vocabinfo
tf.estimator.WarmStartSettings View source on GitHub Settings for warm-starting in tf.estimator.Estimators. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.estimator.WarmStartSettings tf.estimator.WarmStartSettings( ckpt_to_initialize_from, vars_to_warm_start='.*', var_name_to_vocab_info=None, var_name_to_prev_var_name=None ) Example Use with canned tf.estimator.DNNEstimator: emb_vocab_file = tf.feature_column.embedding_column( tf.feature_column.categorical_column_with_vocabulary_file( "sc_vocab_file", "new_vocab.txt", vocab_size=100), dimension=8) emb_vocab_list = tf.feature_column.embedding_column( tf.feature_column.categorical_column_with_vocabulary_list( "sc_vocab_list", vocabulary_list=["a", "b"]), dimension=8) estimator = tf.estimator.DNNClassifier( hidden_units=[128, 64], feature_columns=[emb_vocab_file, emb_vocab_list], warm_start_from=ws) where ws could be defined as: Warm-start all weights in the model (input layer and hidden weights). Either the directory or a specific checkpoint can be provided (in the case of the former, the latest checkpoint will be used): ws = WarmStartSettings(ckpt_to_initialize_from="/tmp") ws = WarmStartSettings(ckpt_to_initialize_from="/tmp/model-1000") Warm-start only the embeddings (input layer): ws = WarmStartSettings(ckpt_to_initialize_from="/tmp", vars_to_warm_start=".*input_layer.*") Warm-start all weights but the embedding parameters corresponding to sc_vocab_file have a different vocab from the one used in the current model: vocab_info = tf.estimator.VocabInfo( new_vocab=sc_vocab_file.vocabulary_file, new_vocab_size=sc_vocab_file.vocabulary_size, num_oov_buckets=sc_vocab_file.num_oov_buckets, old_vocab="old_vocab.txt" ) ws = WarmStartSettings( ckpt_to_initialize_from="/tmp", var_name_to_vocab_info={ "input_layer/sc_vocab_file_embedding/embedding_weights": vocab_info }) Warm-start only sc_vocab_file embeddings (and no other variables), which have a different vocab from the one used in the current model: vocab_info = tf.estimator.VocabInfo( new_vocab=sc_vocab_file.vocabulary_file, new_vocab_size=sc_vocab_file.vocabulary_size, num_oov_buckets=sc_vocab_file.num_oov_buckets, old_vocab="old_vocab.txt" ) ws = WarmStartSettings( ckpt_to_initialize_from="/tmp", vars_to_warm_start=None, var_name_to_vocab_info={ "input_layer/sc_vocab_file_embedding/embedding_weights": vocab_info }) Warm-start all weights but the parameters corresponding to sc_vocab_file have a different vocab from the one used in current checkpoint, and only 100 of those entries were used: vocab_info = tf.estimator.VocabInfo( new_vocab=sc_vocab_file.vocabulary_file, new_vocab_size=sc_vocab_file.vocabulary_size, num_oov_buckets=sc_vocab_file.num_oov_buckets, old_vocab="old_vocab.txt", old_vocab_size=100 ) ws = WarmStartSettings( ckpt_to_initialize_from="/tmp", var_name_to_vocab_info={ "input_layer/sc_vocab_file_embedding/embedding_weights": vocab_info }) Warm-start all weights but the parameters corresponding to sc_vocab_file have a different vocab from the one used in current checkpoint and the parameters corresponding to sc_vocab_list have a different name from the current checkpoint: vocab_info = tf.estimator.VocabInfo( new_vocab=sc_vocab_file.vocabulary_file, new_vocab_size=sc_vocab_file.vocabulary_size, num_oov_buckets=sc_vocab_file.num_oov_buckets, old_vocab="old_vocab.txt", old_vocab_size=100 ) ws = WarmStartSettings( ckpt_to_initialize_from="/tmp", var_name_to_vocab_info={ "input_layer/sc_vocab_file_embedding/embedding_weights": vocab_info }, var_name_to_prev_var_name={ "input_layer/sc_vocab_list_embedding/embedding_weights": "old_tensor_name" }) Warm-start all TRAINABLE variables: ws = WarmStartSettings(ckpt_to_initialize_from="/tmp", vars_to_warm_start=".*") Warm-start all variables (including non-TRAINABLE): ws = WarmStartSettings(ckpt_to_initialize_from="/tmp", vars_to_warm_start=[".*"]) Warm-start non-TRAINABLE variables "v1", "v1/Momentum", and "v2" but not "v2/momentum": ws = WarmStartSettings(ckpt_to_initialize_from="/tmp", vars_to_warm_start=["v1", "v2[^/]"]) Attributes ckpt_to_initialize_from [Required] A string specifying the directory with checkpoint file(s) or path to checkpoint from which to warm-start the model parameters. vars_to_warm_start [Optional] One of the following: A regular expression (string) that captures which variables to warm-start (see tf.compat.v1.get_collection). This expression will only consider variables in the TRAINABLE_VARIABLES collection -- if you need to warm-start non_TRAINABLE vars (such as optimizer accumulators or batch norm statistics), please use the below option. A list of strings, each a regex scope provided to tf.compat.v1.get_collection with GLOBAL_VARIABLES (please see tf.compat.v1.get_collection). For backwards compatibility reasons, this is separate from the single-string argument type. A list of Variables to warm-start. If you do not have access to the Variable objects at the call site, please use the above option. None, in which case only TRAINABLE variables specified in var_name_to_vocab_info will be warm-started. Defaults to '.*', which warm-starts all variables in the TRAINABLE_VARIABLES collection. Note that this excludes variables such as accumulators and moving statistics from batch norm. var_name_to_vocab_info [Optional] Dict of variable names (strings) to tf.estimator.VocabInfo. The variable names should be "full" variables, not the names of the partitions. If not explicitly provided, the variable is assumed to have no (changes to) vocabulary. var_name_to_prev_var_name [Optional] Dict of variable names (strings) to name of the previously-trained variable in ckpt_to_initialize_from. If not explicitly provided, the name of the variable is assumed to be same between previous checkpoint and current model. Note that this has no effect on the set of variables that is warm-started, and only controls name mapping (use vars_to_warm_start for controlling what variables to warm-start).
tensorflow.estimator.warmstartsettings
tf.executing_eagerly View source on GitHub Checks whether the current thread has eager execution enabled. tf.executing_eagerly() Eager execution is enabled by default and this API returns True in most of cases. However, this API might return False in the following use cases. Executing inside tf.function, unless under tf.init_scope or tf.config.run_functions_eagerly(True) is previously called. Executing inside a transformation function for tf.dataset. tf.compat.v1.disable_eager_execution() is called. General case: print(tf.executing_eagerly()) True Inside tf.function: @tf.function def fn(): with tf.init_scope(): print(tf.executing_eagerly()) print(tf.executing_eagerly()) fn() True False Inside tf.function after tf.config.run_functions_eagerly(True) is called: tf.config.run_functions_eagerly(True) @tf.function def fn(): with tf.init_scope(): print(tf.executing_eagerly()) print(tf.executing_eagerly()) fn() True True tf.config.run_functions_eagerly(False) Inside a transformation function for tf.dataset: def data_fn(x): print(tf.executing_eagerly()) return x dataset = tf.data.Dataset.range(100) dataset = dataset.map(data_fn) False Returns True if the current thread has eager execution enabled.
tensorflow.executing_eagerly
tf.expand_dims View source on GitHub Returns a tensor with a length 1 axis inserted at index axis. tf.expand_dims( input, axis, name=None ) Given a tensor input, this operation inserts a dimension of length 1 at the dimension index axis of input's shape. The dimension index follows Python indexing rules: It's zero-based, a negative index it is counted backward from the end. This operation is useful to: Add an outer "batch" dimension to a single element. Align axes for broadcasting. To add an inner vector length axis to a tensor of scalars. For example: If you have a single image of shape [height, width, channels]: image = tf.zeros([10,10,3]) You can add an outer batch axis by passing axis=0: tf.expand_dims(image, axis=0).shape.as_list() [1, 10, 10, 3] The new axis location matches Python list.insert(axis, 1): tf.expand_dims(image, axis=1).shape.as_list() [10, 1, 10, 3] Following standard Python indexing rules, a negative axis counts from the end so axis=-1 adds an inner most dimension: tf.expand_dims(image, -1).shape.as_list() [10, 10, 3, 1] This operation requires that axis is a valid index for input.shape, following Python indexing rules: -1-tf.rank(input) <= axis <= tf.rank(input) This operation is related to: tf.squeeze, which removes dimensions of size 1. tf.reshape, which provides more flexible reshaping capability. tf.sparse.expand_dims, which provides this functionality for tf.SparseTensor Args input A Tensor. axis Integer specifying the dimension index at which to expand the shape of input. Given an input of D dimensions, axis must be in range [-(D+1), D] (inclusive). name Optional string. The name of the output Tensor. Returns A tensor with the same data as input, with an additional dimension inserted at the index specified by axis. Raises ValueError If axis is not specified. InvalidArgumentError If axis is out of range [-(D+1), D].
tensorflow.expand_dims
Module: tf.experimental Public API for tf.experimental namespace. Modules dlpack module: Public API for tf.experimental.dlpack namespace. numpy module: # tf.experimental.numpy: NumPy API on TensorFlow. tensorrt module: Public API for tf.experimental.tensorrt namespace. Classes class Optional: Represents a value that may or may not be present. Functions async_clear_error(...): Clear pending operations and error statuses in async execution. async_scope(...): Context manager for grouping async operations. function_executor_type(...): Context manager for setting the executor of eager defined functions. register_filesystem_plugin(...): Loads a TensorFlow FileSystem plugin.
tensorflow.experimental
tf.experimental.async_clear_error Clear pending operations and error statuses in async execution. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.experimental.async_clear_error tf.experimental.async_clear_error() In async execution mode, an error in op/function execution can lead to errors in subsequent ops/functions that are scheduled but not yet executed. Calling this method clears all pending operations and reset the async execution state. Example: while True: try: # Step function updates the metric `loss` internally train_step_fn() except tf.errors.OutOfRangeError: tf.experimental.async_clear_error() break logging.info('loss = %s', loss.numpy())
tensorflow.experimental.async_clear_error
tf.experimental.async_scope Context manager for grouping async operations. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.experimental.async_scope @tf_contextlib.contextmanager tf.experimental.async_scope() Ops/function calls inside the scope can return before finishing the actual execution. When exiting the async scope, a synchronization barrier will be automatically added to ensure the completion of all async op and function execution, potentially raising exceptions if async execution results in an error state. Users may write the following code to asynchronuously invoke train_step_fn and log the loss metric for every num_steps steps in a training loop. train_step_fn internally consumes data using iterator.get_next(), and may throw OutOfRangeError when running out of data. In the case: try: with tf.experimental.async_scope(): for _ in range(num_steps): # Step function updates the metric `loss` internally train_step_fn() except tf.errors.OutOfRangeError: tf.experimental.async_clear_error() logging.info('loss = %s', loss.numpy()) Yields Context manager for grouping async operations.
tensorflow.experimental.async_scope
Module: tf.experimental.dlpack Public API for tf.experimental.dlpack namespace. Functions from_dlpack(...): Returns the Tensorflow eager tensor. to_dlpack(...): Returns the dlpack capsule representing the tensor.
tensorflow.experimental.dlpack
tf.experimental.dlpack.from_dlpack Returns the Tensorflow eager tensor. tf.experimental.dlpack.from_dlpack( dlcapsule ) The returned tensor uses the memory shared by dlpack capsules from other framework. a = tf.experimental.dlpack.from_dlpack(dlcapsule) # `a` uses the memory shared by dlpack Args dlcapsule A PyCapsule named as dltensor Returns A Tensorflow eager tensor
tensorflow.experimental.dlpack.from_dlpack
tf.experimental.dlpack.to_dlpack Returns the dlpack capsule representing the tensor. tf.experimental.dlpack.to_dlpack( tf_tensor ) This operation ensures the underlying data memory is ready when returns. a = tf.tensor([1, 10]) dlcapsule = tf.experimental.dlpack.to_dlpack(a) # dlcapsule represents the dlpack data structure Args tf_tensor Tensorflow eager tensor, to be converted to dlpack capsule. Returns A PyCapsule named as dltensor, which shares the underlying memory to other framework. This PyCapsule can be consumed only once.
tensorflow.experimental.dlpack.to_dlpack
tf.experimental.function_executor_type View source on GitHub Context manager for setting the executor of eager defined functions. View aliases Compat aliases for migration See Migration guide for more details. tf.compat.v1.experimental.function_executor_type @tf_contextlib.contextmanager tf.experimental.function_executor_type( executor_type ) Eager defined functions are functions decorated by tf.contrib.eager.defun. Args executor_type a string for the name of the executor to be used to execute functions defined by tf.contrib.eager.defun. Yields Context manager for setting the executor of eager defined functions.
tensorflow.experimental.function_executor_type
Module: tf.experimental.numpy tf.experimental.numpy: NumPy API on TensorFlow. This module provides a subset of NumPy API, built on top of TensorFlow operations. APIs are based on and have been tested with NumPy 1.16 version. The set of supported APIs may be expanded over time. Also future releases may change the baseline version of NumPy API being supported. A list of some systematic differences with NumPy are listed later in the "Differences with NumPy" section. Getting Started Please also see TensorFlow NumPy Guide. In the code snippets below, we will assume that tf.experimental.numpy is imported as tnp and NumPy is imported as np print(tnp.ones([2,1]) + tnp.ones([1, 2])) Types The module provides an ndarray class which wraps an immutable tf.Tensor. Additional functions are provided which accept array-like objects. Here array-like objects includes ndarrays as defined by this module, as well as tf.Tensor, in addition to types accepted by NumPy. A subset of NumPy dtypes are supported. Type promotion follows NumPy semantics. print(tnp.ones([1, 2], dtype=tnp.int16) + tnp.ones([2, 1], dtype=tnp.uint8)) Array Interface The ndarray class implements the __array__ interface. This should allow these objects to be passed into contexts that expect a NumPy or array-like object (e.g. matplotlib). np.sum(tnp.ones([1, 2]) + np.ones([2, 1])) TF Interoperability The TF-NumPy API calls can be interleaved with TensorFlow calls without incurring Tensor data copies. This is true even if the ndarray or tf.Tensor is placed on a non-CPU device. In general, the expected behavior should be on par with that of code involving tf.Tensor and running stateless TensorFlow functions on them. tnp.sum(tnp.ones([1, 2]) + tf.ones([2, 1])) Note that the __array_priority__ is currently chosen to be lower than tf.Tensor. Hence the + operator above returns a tf.Tensor. Additional examples of interopability include: using with tf.GradientTape() scope to compute gradients through the TF-NumPy API calls. using tf.distribution.Strategy scope for distributed execution using tf.vectorized_map() for speeding up code using auto-vectorization Device Support Given that ndarray and functions wrap TensorFlow constructs, the code will have GPU and TPU support on par with TensorFlow. Device placement can be controlled by using with tf.device scopes. Note that these devices could be local or remote. with tf.device("GPU:0"): x = tnp.ones([1, 2]) print(tf.convert_to_tensor(x).device) Graph and Eager Modes Eager mode execution should typically match NumPy semantics of executing op-by-op. However the same code can be executed in graph mode, by putting it inside a tf.function. The function body can contain NumPy code, and the inputs can be ndarray as well. @tf.function def f(x, y): return tnp.sum(x + y) f(tnp.ones([1, 2]), tf.ones([2, 1])) Python control flow based on ndarray values will be translated by autograph into tf.cond and tf.while_loop constructs. The code can be XLA compiled for further optimizations. However, note that graph mode execution can change behavior of certain operations since symbolic execution may not have information that is computed during runtime. Some differences are: Shapes can be incomplete or unknown in graph mode. This means that ndarray.shape, ndarray.size and ndarray.ndim can return ndarray objects instead of returning integer (or tuple of integer) values. __len__, __iter__ and __index__ properties of ndarray may similarly not be supported in graph mode. Code using these may need to change to explicit shape operations or control flow constructs. Also note the autograph limitations. Mutation and Variables ndarrays currently wrap immutable tf.Tensor. Hence mutation operations like slice assigns are not supported. This may change in the future. Note however that one can directly construct a tf.Variable and use that with the TF-NumPy APIs. tf_var = tf.Variable(2.0) tf_var.assign_add(tnp.square(tf_var)) Differences with NumPy Here is a non-exhaustive list of differences: Not all dtypes are currently supported. e.g. np.float96, np.float128. np.object, np.str, np.recarray types are not supported. ndarray storage is in C order only. Fortran order, views, stride_tricks are not supported. Only a subset of functions and modules are supported. This set will be expanded over time. For supported functions, some arguments or argument values may not be supported. This differences are generally provide in the function comments. Full ufunc support is also not provided. Buffer mutation is currently not supported. ndarrays wrap immutable tensors. This means that output buffer arguments (e..g out in ufuncs) are not supported NumPy C API is not supported. NumPy's Cython and Swig integration are not supported. Modules random module: Public API for tf.experimental.numpy.random namespace. Classes class bool_: Boolean type (True or False), stored as a byte. class complex128: Complex number type composed of two double-precision floating-point class complex64: Complex number type composed of two single-precision floating-point class complex_: Complex number type composed of two double-precision floating-point class float16: Half-precision floating-point number type. class float32: Single-precision floating-point number type, compatible with C float. class float64: Double-precision floating-point number type, compatible with Python float class float_: Double-precision floating-point number type, compatible with Python float class iinfo: iinfo(type) class inexact: Abstract base class of all numeric scalar types with a (potentially) class int16: Signed integer type, compatible with C short. class int32: Signed integer type, compatible with C int. class int64: Signed integer type, compatible with Python int anc C long. class int8: Signed integer type, compatible with C char. class int_: Signed integer type, compatible with Python int anc C long. class ndarray: Equivalent of numpy.ndarray backed by TensorFlow tensors. class object_: Any Python object. class string_: bytes(iterable_of_ints) -> bytes class uint16: Unsigned integer type, compatible with C unsigned short. class uint32: Unsigned integer type, compatible with C unsigned int. class uint64: Unsigned integer type, compatible with C unsigned long. class uint8: Unsigned integer type, compatible with C unsigned char. class unicode_: str(object='') -> str Functions abs(...): TensorFlow variant of NumPy's abs. absolute(...): TensorFlow variant of NumPy's absolute. add(...): TensorFlow variant of NumPy's add. all(...): TensorFlow variant of NumPy's all. allclose(...): TensorFlow variant of NumPy's allclose. amax(...): TensorFlow variant of NumPy's amax. amin(...): TensorFlow variant of NumPy's amin. angle(...): TensorFlow variant of NumPy's angle. any(...): TensorFlow variant of NumPy's any. append(...): TensorFlow variant of NumPy's append. arange(...): TensorFlow variant of NumPy's arange. arccos(...): TensorFlow variant of NumPy's arccos. arccosh(...): TensorFlow variant of NumPy's arccosh. arcsin(...): TensorFlow variant of NumPy's arcsin. arcsinh(...): TensorFlow variant of NumPy's arcsinh. arctan(...): TensorFlow variant of NumPy's arctan. arctan2(...): TensorFlow variant of NumPy's arctan2. arctanh(...): TensorFlow variant of NumPy's arctanh. argmax(...): TensorFlow variant of NumPy's argmax. argmin(...): TensorFlow variant of NumPy's argmin. argsort(...): TensorFlow variant of NumPy's argsort. around(...): TensorFlow variant of NumPy's around. array(...): TensorFlow variant of NumPy's array. array_equal(...): TensorFlow variant of NumPy's array_equal. asanyarray(...): TensorFlow variant of NumPy's asanyarray. asarray(...): TensorFlow variant of NumPy's asarray. ascontiguousarray(...): TensorFlow variant of NumPy's ascontiguousarray. atleast_1d(...): TensorFlow variant of NumPy's atleast_1d. atleast_2d(...): TensorFlow variant of NumPy's atleast_2d. atleast_3d(...): TensorFlow variant of NumPy's atleast_3d. average(...): TensorFlow variant of NumPy's average. bitwise_and(...): TensorFlow variant of NumPy's bitwise_and. bitwise_not(...): TensorFlow variant of NumPy's bitwise_not. bitwise_or(...): TensorFlow variant of NumPy's bitwise_or. bitwise_xor(...): TensorFlow variant of NumPy's bitwise_xor. broadcast_arrays(...): TensorFlow variant of NumPy's broadcast_arrays. broadcast_to(...): TensorFlow variant of NumPy's broadcast_to. cbrt(...): TensorFlow variant of NumPy's cbrt. ceil(...): TensorFlow variant of NumPy's ceil. clip(...): TensorFlow variant of NumPy's clip. compress(...): TensorFlow variant of NumPy's compress. concatenate(...): TensorFlow variant of NumPy's concatenate. conj(...): TensorFlow variant of NumPy's conj. conjugate(...): TensorFlow variant of NumPy's conjugate. copy(...): TensorFlow variant of NumPy's copy. cos(...): TensorFlow variant of NumPy's cos. cosh(...): TensorFlow variant of NumPy's cosh. count_nonzero(...): TensorFlow variant of NumPy's count_nonzero. cross(...): TensorFlow variant of NumPy's cross. cumprod(...): TensorFlow variant of NumPy's cumprod. cumsum(...): TensorFlow variant of NumPy's cumsum. deg2rad(...): TensorFlow variant of NumPy's deg2rad. diag(...): TensorFlow variant of NumPy's diag. diag_indices(...): TensorFlow variant of NumPy's diag_indices. diagflat(...): TensorFlow variant of NumPy's diagflat. diagonal(...): TensorFlow variant of NumPy's diagonal. diff(...): TensorFlow variant of NumPy's diff. divide(...): TensorFlow variant of NumPy's divide. divmod(...): TensorFlow variant of NumPy's divmod. dot(...): TensorFlow variant of NumPy's dot. dsplit(...): TensorFlow variant of NumPy's dsplit. dstack(...): TensorFlow variant of NumPy's dstack. einsum(...): TensorFlow variant of NumPy's einsum. empty(...): TensorFlow variant of NumPy's empty. empty_like(...): TensorFlow variant of NumPy's empty_like. equal(...): TensorFlow variant of NumPy's equal. exp(...): TensorFlow variant of NumPy's exp. exp2(...): TensorFlow variant of NumPy's exp2. expand_dims(...): TensorFlow variant of NumPy's expand_dims. expm1(...): TensorFlow variant of NumPy's expm1. eye(...): TensorFlow variant of NumPy's eye. fabs(...): TensorFlow variant of NumPy's fabs. finfo(...): TensorFlow variant of NumPy's finfo. fix(...): TensorFlow variant of NumPy's fix. flip(...): TensorFlow variant of NumPy's flip. fliplr(...): TensorFlow variant of NumPy's fliplr. flipud(...): TensorFlow variant of NumPy's flipud. float_power(...): TensorFlow variant of NumPy's float_power. floor(...): TensorFlow variant of NumPy's floor. floor_divide(...): TensorFlow variant of NumPy's floor_divide. full(...): TensorFlow variant of NumPy's full. full_like(...): TensorFlow variant of NumPy's full_like. gcd(...): TensorFlow variant of NumPy's gcd. geomspace(...): TensorFlow variant of NumPy's geomspace. greater(...): TensorFlow variant of NumPy's greater. greater_equal(...): TensorFlow variant of NumPy's greater_equal. heaviside(...): TensorFlow variant of NumPy's heaviside. hsplit(...): TensorFlow variant of NumPy's hsplit. hstack(...): TensorFlow variant of NumPy's hstack. hypot(...): TensorFlow variant of NumPy's hypot. identity(...): TensorFlow variant of NumPy's identity. imag(...): TensorFlow variant of NumPy's imag. inner(...): TensorFlow variant of NumPy's inner. isclose(...): TensorFlow variant of NumPy's isclose. iscomplex(...): TensorFlow variant of NumPy's iscomplex. iscomplexobj(...): TensorFlow variant of NumPy's iscomplexobj. isfinite(...): TensorFlow variant of NumPy's isfinite. isinf(...): TensorFlow variant of NumPy's isinf. isnan(...): TensorFlow variant of NumPy's isnan. isneginf(...): TensorFlow variant of NumPy's isneginf. isposinf(...): TensorFlow variant of NumPy's isposinf. isreal(...): TensorFlow variant of NumPy's isreal. isrealobj(...): TensorFlow variant of NumPy's isrealobj. isscalar(...): TensorFlow variant of NumPy's isscalar. issubdtype(...): Returns True if first argument is a typecode lower/equal in type hierarchy. ix_(...): TensorFlow variant of NumPy's ix_. kron(...): TensorFlow variant of NumPy's kron. lcm(...): TensorFlow variant of NumPy's lcm. less(...): TensorFlow variant of NumPy's less. less_equal(...): TensorFlow variant of NumPy's less_equal. linspace(...): TensorFlow variant of NumPy's linspace. log(...): TensorFlow variant of NumPy's log. log10(...): TensorFlow variant of NumPy's log10. log1p(...): TensorFlow variant of NumPy's log1p. log2(...): TensorFlow variant of NumPy's log2. logaddexp(...): TensorFlow variant of NumPy's logaddexp. logaddexp2(...): TensorFlow variant of NumPy's logaddexp2. logical_and(...): TensorFlow variant of NumPy's logical_and. logical_not(...): TensorFlow variant of NumPy's logical_not. logical_or(...): TensorFlow variant of NumPy's logical_or. logical_xor(...): TensorFlow variant of NumPy's logical_xor. logspace(...): TensorFlow variant of NumPy's logspace. matmul(...): TensorFlow variant of NumPy's matmul. max(...): TensorFlow variant of NumPy's max. maximum(...): TensorFlow variant of NumPy's maximum. mean(...): TensorFlow variant of NumPy's mean. meshgrid(...): TensorFlow variant of NumPy's meshgrid. min(...): TensorFlow variant of NumPy's min. minimum(...): TensorFlow variant of NumPy's minimum. mod(...): TensorFlow variant of NumPy's mod. moveaxis(...): TensorFlow variant of NumPy's moveaxis. multiply(...): TensorFlow variant of NumPy's multiply. nanmean(...): TensorFlow variant of NumPy's nanmean. nanprod(...): TensorFlow variant of NumPy's nanprod. nansum(...): TensorFlow variant of NumPy's nansum. ndim(...): TensorFlow variant of NumPy's ndim. negative(...): TensorFlow variant of NumPy's negative. nextafter(...): TensorFlow variant of NumPy's nextafter. nonzero(...): TensorFlow variant of NumPy's nonzero. not_equal(...): TensorFlow variant of NumPy's not_equal. ones(...): TensorFlow variant of NumPy's ones. ones_like(...): TensorFlow variant of NumPy's ones_like. outer(...): TensorFlow variant of NumPy's outer. pad(...): TensorFlow variant of NumPy's pad. polyval(...): TensorFlow variant of NumPy's polyval. positive(...): TensorFlow variant of NumPy's positive. power(...): TensorFlow variant of NumPy's power. prod(...): TensorFlow variant of NumPy's prod. promote_types(...): TensorFlow variant of NumPy's promote_types. ptp(...): TensorFlow variant of NumPy's ptp. rad2deg(...): TensorFlow variant of NumPy's rad2deg. ravel(...): TensorFlow variant of NumPy's ravel. real(...): TensorFlow variant of NumPy's real. reciprocal(...): TensorFlow variant of NumPy's reciprocal. remainder(...): TensorFlow variant of NumPy's remainder. repeat(...): TensorFlow variant of NumPy's repeat. reshape(...): TensorFlow variant of NumPy's reshape. result_type(...): TensorFlow variant of NumPy's result_type. roll(...): TensorFlow variant of NumPy's roll. rot90(...): TensorFlow variant of NumPy's rot90. round(...): TensorFlow variant of NumPy's round. select(...): TensorFlow variant of NumPy's select. shape(...): TensorFlow variant of NumPy's shape. sign(...): TensorFlow variant of NumPy's sign. signbit(...): TensorFlow variant of NumPy's signbit. sin(...): TensorFlow variant of NumPy's sin. sinc(...): TensorFlow variant of NumPy's sinc. sinh(...): TensorFlow variant of NumPy's sinh. size(...): TensorFlow variant of NumPy's size. sort(...): TensorFlow variant of NumPy's sort. split(...): TensorFlow variant of NumPy's split. sqrt(...): TensorFlow variant of NumPy's sqrt. square(...): TensorFlow variant of NumPy's square. squeeze(...): TensorFlow variant of NumPy's squeeze. stack(...): TensorFlow variant of NumPy's stack. std(...): TensorFlow variant of NumPy's std. subtract(...): TensorFlow variant of NumPy's subtract. sum(...): TensorFlow variant of NumPy's sum. swapaxes(...): TensorFlow variant of NumPy's swapaxes. take(...): TensorFlow variant of NumPy's take. take_along_axis(...): TensorFlow variant of NumPy's take_along_axis. tan(...): TensorFlow variant of NumPy's tan. tanh(...): TensorFlow variant of NumPy's tanh. tensordot(...): TensorFlow variant of NumPy's tensordot. tile(...): TensorFlow variant of NumPy's tile. trace(...): TensorFlow variant of NumPy's trace. transpose(...): TensorFlow variant of NumPy's transpose. tri(...): TensorFlow variant of NumPy's tri. tril(...): TensorFlow variant of NumPy's tril. triu(...): TensorFlow variant of NumPy's triu. true_divide(...): TensorFlow variant of NumPy's true_divide. vander(...): TensorFlow variant of NumPy's vander. var(...): TensorFlow variant of NumPy's var. vdot(...): TensorFlow variant of NumPy's vdot. vsplit(...): TensorFlow variant of NumPy's vsplit. vstack(...): TensorFlow variant of NumPy's vstack. where(...): TensorFlow variant of NumPy's where. zeros(...): TensorFlow variant of NumPy's zeros. zeros_like(...): TensorFlow variant of NumPy's zeros_like. Other Members e 2.718281828459045 inf inf newaxis None pi 3.141592653589793
tensorflow.experimental.numpy
tf.experimental.numpy.abs TensorFlow variant of NumPy's abs. tf.experimental.numpy.abs( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.abs.
tensorflow.experimental.numpy.abs
tf.experimental.numpy.absolute TensorFlow variant of NumPy's absolute. tf.experimental.numpy.absolute( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.absolute.
tensorflow.experimental.numpy.absolute
tf.experimental.numpy.add TensorFlow variant of NumPy's add. tf.experimental.numpy.add( x1, x2 ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.add.
tensorflow.experimental.numpy.add
tf.experimental.numpy.all TensorFlow variant of NumPy's all. tf.experimental.numpy.all( a, axis=None, keepdims=None ) Unsupported arguments: out. See the NumPy documentation for numpy.all.
tensorflow.experimental.numpy.all
tf.experimental.numpy.allclose TensorFlow variant of NumPy's allclose. tf.experimental.numpy.allclose( a, b, rtol=1e-05, atol=1e-08, equal_nan=False ) See the NumPy documentation for numpy.allclose.
tensorflow.experimental.numpy.allclose
tf.experimental.numpy.amax TensorFlow variant of NumPy's amax. tf.experimental.numpy.amax( a, axis=None, keepdims=None ) Unsupported arguments: out, initial, where. See the NumPy documentation for numpy.amax.
tensorflow.experimental.numpy.amax
tf.experimental.numpy.amin TensorFlow variant of NumPy's amin. tf.experimental.numpy.amin( a, axis=None, keepdims=None ) Unsupported arguments: out, initial, where. See the NumPy documentation for numpy.amin.
tensorflow.experimental.numpy.amin
tf.experimental.numpy.angle TensorFlow variant of NumPy's angle. tf.experimental.numpy.angle( z, deg=False ) See the NumPy documentation for numpy.angle.
tensorflow.experimental.numpy.angle
tf.experimental.numpy.any TensorFlow variant of NumPy's any. tf.experimental.numpy.any( a, axis=None, keepdims=None ) Unsupported arguments: out. See the NumPy documentation for numpy.any.
tensorflow.experimental.numpy.any
tf.experimental.numpy.append TensorFlow variant of NumPy's append. tf.experimental.numpy.append( arr, values, axis=None ) See the NumPy documentation for numpy.append.
tensorflow.experimental.numpy.append
tf.experimental.numpy.arange TensorFlow variant of NumPy's arange. tf.experimental.numpy.arange( start, stop=None, step=1, dtype=None ) Returns step-separated values in the range [start, stop). Args: start: Start of the interval. Included in the range. stop: End of the interval. If not specified, start is treated as 0 and start value is used as stop. If specified, it is not included in the range if step is integer. When step is floating point, it may or may not be included. step: The difference between 2 consecutive values in the output range. It is recommended to use linspace instead of using non-integer values for step. dtype: Optional. Type of the resulting ndarray. Could be a python type, a NumPy type or a TensorFlow DType. If not provided, the largest type of start, stop, step is used. Raises: ValueError: If step is zero. See the NumPy documentation for numpy.arange.
tensorflow.experimental.numpy.arange
tf.experimental.numpy.arccos TensorFlow variant of NumPy's arccos. tf.experimental.numpy.arccos( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arccos.
tensorflow.experimental.numpy.arccos
tf.experimental.numpy.arccosh TensorFlow variant of NumPy's arccosh. tf.experimental.numpy.arccosh( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arccosh.
tensorflow.experimental.numpy.arccosh
tf.experimental.numpy.arcsin TensorFlow variant of NumPy's arcsin. tf.experimental.numpy.arcsin( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arcsin.
tensorflow.experimental.numpy.arcsin
tf.experimental.numpy.arcsinh TensorFlow variant of NumPy's arcsinh. tf.experimental.numpy.arcsinh( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arcsinh.
tensorflow.experimental.numpy.arcsinh
tf.experimental.numpy.arctan TensorFlow variant of NumPy's arctan. tf.experimental.numpy.arctan( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arctan.
tensorflow.experimental.numpy.arctan
tf.experimental.numpy.arctan2 TensorFlow variant of NumPy's arctan2. tf.experimental.numpy.arctan2( x1, x2 ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arctan2.
tensorflow.experimental.numpy.arctan2
tf.experimental.numpy.arctanh TensorFlow variant of NumPy's arctanh. tf.experimental.numpy.arctanh( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.arctanh.
tensorflow.experimental.numpy.arctanh
tf.experimental.numpy.argmax TensorFlow variant of NumPy's argmax. tf.experimental.numpy.argmax( a, axis=None ) Unsupported arguments: out. See the NumPy documentation for numpy.argmax.
tensorflow.experimental.numpy.argmax
tf.experimental.numpy.argmin TensorFlow variant of NumPy's argmin. tf.experimental.numpy.argmin( a, axis=None ) Unsupported arguments: out. See the NumPy documentation for numpy.argmin.
tensorflow.experimental.numpy.argmin
tf.experimental.numpy.argsort TensorFlow variant of NumPy's argsort. tf.experimental.numpy.argsort( a, axis=-1, kind='quicksort', order=None ) See the NumPy documentation for numpy.argsort.
tensorflow.experimental.numpy.argsort
tf.experimental.numpy.around TensorFlow variant of NumPy's around. tf.experimental.numpy.around( a, decimals=0 ) Unsupported arguments: out. See the NumPy documentation for numpy.around.
tensorflow.experimental.numpy.around
tf.experimental.numpy.array TensorFlow variant of NumPy's array. tf.experimental.numpy.array( val, dtype=None, copy=True, ndmin=0 ) Since Tensors are immutable, a copy is made only if val is placed on a different device than the current one. Even if copy is False, a new Tensor may need to be built to satisfy dtype and ndim. This is used only if val is an ndarray or a Tensor. See the NumPy documentation for numpy.array.
tensorflow.experimental.numpy.array
tf.experimental.numpy.array_equal TensorFlow variant of NumPy's array_equal. tf.experimental.numpy.array_equal( a1, a2 ) Unsupported arguments: equal_nan. See the NumPy documentation for numpy.array_equal.
tensorflow.experimental.numpy.array_equal
tf.experimental.numpy.asanyarray TensorFlow variant of NumPy's asanyarray. tf.experimental.numpy.asanyarray( a, dtype=None ) Unsupported arguments: order. See the NumPy documentation for numpy.asanyarray.
tensorflow.experimental.numpy.asanyarray
tf.experimental.numpy.asarray TensorFlow variant of NumPy's asarray. tf.experimental.numpy.asarray( a, dtype=None ) Unsupported arguments: order. See the NumPy documentation for numpy.asarray.
tensorflow.experimental.numpy.asarray
tf.experimental.numpy.ascontiguousarray TensorFlow variant of NumPy's ascontiguousarray. tf.experimental.numpy.ascontiguousarray( a, dtype=None ) See the NumPy documentation for numpy.ascontiguousarray.
tensorflow.experimental.numpy.ascontiguousarray
tf.experimental.numpy.atleast_1d TensorFlow variant of NumPy's atleast_1d. tf.experimental.numpy.atleast_1d( *arys ) See the NumPy documentation for numpy.atleast_1d.
tensorflow.experimental.numpy.atleast_1d
tf.experimental.numpy.atleast_2d TensorFlow variant of NumPy's atleast_2d. tf.experimental.numpy.atleast_2d( *arys ) See the NumPy documentation for numpy.atleast_2d.
tensorflow.experimental.numpy.atleast_2d
tf.experimental.numpy.atleast_3d TensorFlow variant of NumPy's atleast_3d. tf.experimental.numpy.atleast_3d( *arys ) See the NumPy documentation for numpy.atleast_3d.
tensorflow.experimental.numpy.atleast_3d
tf.experimental.numpy.average TensorFlow variant of NumPy's average. tf.experimental.numpy.average( a, axis=None, weights=None, returned=False ) See the NumPy documentation for numpy.average.
tensorflow.experimental.numpy.average
tf.experimental.numpy.bitwise_and TensorFlow variant of NumPy's bitwise_and. tf.experimental.numpy.bitwise_and( x1, x2 ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.bitwise_and.
tensorflow.experimental.numpy.bitwise_and
tf.experimental.numpy.bitwise_not TensorFlow variant of NumPy's bitwise_not. tf.experimental.numpy.bitwise_not( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.bitwise_not.
tensorflow.experimental.numpy.bitwise_not
tf.experimental.numpy.bitwise_or TensorFlow variant of NumPy's bitwise_or. tf.experimental.numpy.bitwise_or( x1, x2 ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.bitwise_or.
tensorflow.experimental.numpy.bitwise_or
tf.experimental.numpy.bitwise_xor TensorFlow variant of NumPy's bitwise_xor. tf.experimental.numpy.bitwise_xor( x1, x2 ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.bitwise_xor.
tensorflow.experimental.numpy.bitwise_xor
tf.experimental.numpy.bool_ Boolean type (True or False), stored as a byte. tf.experimental.numpy.bool_( *args, **kwargs ) Character code: '?'. Alias: np.bool8. Methods all all() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. any any() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. argmax argmax() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. argmin argmin() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. argsort argsort() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. astype astype() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. byteswap byteswap() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. choose choose() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. clip clip() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. compress compress() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. conj conj() conjugate conjugate() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. copy copy() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. cumprod cumprod() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. cumsum cumsum() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. diagonal diagonal() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. dump dump() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. dumps dumps() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. fill fill() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. flatten flatten() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. getfield getfield() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. item item() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. itemset itemset() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. max max() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. mean mean() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. min min() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. newbyteorder newbyteorder() newbyteorder(new_order='S') Return a new dtype with a different byte order. Changes are also made in all fields and sub-arrays of the data type. The new_order code can be any from the following: 'S' - swap dtype from current to opposite endian '<', 'L'- little endian '>', 'B'- big endian '=', 'N'- native order '|', 'I'- ignore (no change to byte order) Parameters new_order : str, optional Byte order to force; a value from the byte order specifications above. The default value ('S') results in swapping the current byte order. The code does a case-insensitive check on the first letter of new_order for the alternatives above. For example, any of 'B' or 'b' or 'biggish' are valid to specify big-endian. Returns new_dtype : dtype New dtype object with the given change to the byte order. nonzero nonzero() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. prod prod() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. ptp ptp() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. put put() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. ravel ravel() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. repeat repeat() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. reshape reshape() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. resize resize() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. round round() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. searchsorted searchsorted() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. setfield setfield() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. setflags setflags() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. sort sort() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. squeeze squeeze() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. std std() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. sum sum() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. swapaxes swapaxes() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. take take() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. tobytes tobytes() tofile tofile() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. tolist tolist() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. tostring tostring() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. trace trace() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. transpose transpose() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. var var() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. view view() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. __abs__ __abs__() abs(self) __add__ __add__( value, / ) Return self+value. __and__ __and__( value, / ) Return self&value. __bool__ __bool__() self != 0 __eq__ __eq__( value, / ) Return self==value. __floordiv__ __floordiv__( value, / ) Return self//value. __ge__ __ge__( value, / ) Return self>=value. __getitem__ __getitem__( key, / ) Return self[key]. __gt__ __gt__( value, / ) Return self>value. __invert__ __invert__() ~self __le__ __le__( value, / ) Return self<=value. __lt__ __lt__( value, / ) Return self<value. __mod__ __mod__( value, / ) Return self%value. __mul__ __mul__( value, / ) Return self*value. __ne__ __ne__( value, / ) Return self!=value. __neg__ __neg__() -self __or__ __or__( value, / ) Return self|value. __pos__ __pos__() +self __pow__ __pow__( value, mod, / ) Return pow(self, value, mod). __radd__ __radd__( value, / ) Return value+self. __rand__ __rand__( value, / ) Return value&self. __rfloordiv__ __rfloordiv__( value, / ) Return value//self. __rmod__ __rmod__( value, / ) Return value%self. __rmul__ __rmul__( value, / ) Return value*self. __ror__ __ror__( value, / ) Return value|self. __rpow__ __rpow__( value, mod, / ) Return pow(value, self, mod). __rsub__ __rsub__( value, / ) Return value-self. __rtruediv__ __rtruediv__( value, / ) Return value/self. __rxor__ __rxor__( value, / ) Return value^self. __sub__ __sub__( value, / ) Return self-value. __truediv__ __truediv__( value, / ) Return self/value. __xor__ __xor__( value, / ) Return self^value. Class Variables T base data dtype flags flat imag itemsize nbytes ndim real shape size strides
tensorflow.experimental.numpy.bool_
tf.experimental.numpy.broadcast_arrays TensorFlow variant of NumPy's broadcast_arrays. tf.experimental.numpy.broadcast_arrays( *args, **kwargs ) Unsupported arguments: subok. See the NumPy documentation for numpy.broadcast_arrays.
tensorflow.experimental.numpy.broadcast_arrays
tf.experimental.numpy.broadcast_to TensorFlow variant of NumPy's broadcast_to. tf.experimental.numpy.broadcast_to( array, shape ) Unsupported arguments: subok. See the NumPy documentation for numpy.broadcast_to.
tensorflow.experimental.numpy.broadcast_to
tf.experimental.numpy.cbrt TensorFlow variant of NumPy's cbrt. tf.experimental.numpy.cbrt( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.cbrt.
tensorflow.experimental.numpy.cbrt
tf.experimental.numpy.ceil TensorFlow variant of NumPy's ceil. tf.experimental.numpy.ceil( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.ceil.
tensorflow.experimental.numpy.ceil
tf.experimental.numpy.clip TensorFlow variant of NumPy's clip. View aliases Main aliases tf.experimental.numpy.ndarray.clip tf.experimental.numpy.clip( a, a_min, a_max ) Unsupported arguments: out, kwargs. See the NumPy documentation for numpy.clip.
tensorflow.experimental.numpy.clip
tf.experimental.numpy.complex128 Complex number type composed of two double-precision floating-point Inherits From: inexact View aliases Main aliases tf.experimental.numpy.complex_ tf.experimental.numpy.complex128( *args, **kwargs ) numbers, compatible with Python complex. Character code: 'D'. Canonical name: np.cdouble. Alias: np.cfloat. Alias: np.complex_. Alias on this platform: np.complex128: Complex number type composed of 2 64-bit-precision floating-point numbers. Methods all all() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. any any() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. argmax argmax() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. argmin argmin() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. argsort argsort() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. astype astype() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. byteswap byteswap() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. choose choose() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. clip clip() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. compress compress() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. conj conj() conjugate conjugate() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. copy copy() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. cumprod cumprod() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. cumsum cumsum() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. diagonal diagonal() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. dump dump() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. dumps dumps() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. fill fill() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. flatten flatten() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. getfield getfield() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. item item() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. itemset itemset() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. max max() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. mean mean() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. min min() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. newbyteorder newbyteorder() newbyteorder(new_order='S') Return a new dtype with a different byte order. Changes are also made in all fields and sub-arrays of the data type. The new_order code can be any from the following: 'S' - swap dtype from current to opposite endian '<', 'L'- little endian '>', 'B'- big endian '=', 'N'- native order '|', 'I'- ignore (no change to byte order) Parameters new_order : str, optional Byte order to force; a value from the byte order specifications above. The default value ('S') results in swapping the current byte order. The code does a case-insensitive check on the first letter of new_order for the alternatives above. For example, any of 'B' or 'b' or 'biggish' are valid to specify big-endian. Returns new_dtype : dtype New dtype object with the given change to the byte order. nonzero nonzero() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. prod prod() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. ptp ptp() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. put put() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. ravel ravel() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. repeat repeat() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. reshape reshape() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. resize resize() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. round round() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. searchsorted searchsorted() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. setfield setfield() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. setflags setflags() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. sort sort() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. squeeze squeeze() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. std std() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. sum sum() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. swapaxes swapaxes() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. take take() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. tobytes tobytes() tofile tofile() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. tolist tolist() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. tostring tostring() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. trace trace() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. transpose transpose() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. var var() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. view view() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. __abs__ __abs__() abs(self) __add__ __add__( value, / ) Return self+value. __and__ __and__( value, / ) Return self&value. __bool__ __bool__() self != 0 __eq__ __eq__( value, / ) Return self==value. __floordiv__ __floordiv__( value, / ) Return self//value. __ge__ __ge__( value, / ) Return self>=value. __getitem__ __getitem__( key, / ) Return self[key]. __gt__ __gt__( value, / ) Return self>value. __invert__ __invert__() ~self __le__ __le__( value, / ) Return self<=value. __lt__ __lt__( value, / ) Return self<value. __mod__ __mod__( value, / ) Return self%value. __mul__ __mul__( value, / ) Return self*value. __ne__ __ne__( value, / ) Return self!=value. __neg__ __neg__() -self __or__ __or__( value, / ) Return self|value. __pos__ __pos__() +self __pow__ __pow__( value, mod, / ) Return pow(self, value, mod). __radd__ __radd__( value, / ) Return value+self. __rand__ __rand__( value, / ) Return value&self. __rfloordiv__ __rfloordiv__( value, / ) Return value//self. __rmod__ __rmod__( value, / ) Return value%self. __rmul__ __rmul__( value, / ) Return value*self. __ror__ __ror__( value, / ) Return value|self. __rpow__ __rpow__( value, mod, / ) Return pow(value, self, mod). __rsub__ __rsub__( value, / ) Return value-self. __rtruediv__ __rtruediv__( value, / ) Return value/self. __rxor__ __rxor__( value, / ) Return value^self. __sub__ __sub__( value, / ) Return self-value. __truediv__ __truediv__( value, / ) Return self/value. __xor__ __xor__( value, / ) Return self^value. Class Variables T base data dtype flags flat imag itemsize nbytes ndim real shape size strides
tensorflow.experimental.numpy.complex128
tf.experimental.numpy.complex64 Complex number type composed of two single-precision floating-point Inherits From: inexact tf.experimental.numpy.complex64( *args, **kwargs ) numbers. Character code: 'F'. Canonical name: np.csingle. Alias: np.singlecomplex. Alias on this platform: np.complex64: Complex number type composed of 2 32-bit-precision floating-point numbers. Methods all all() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. any any() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. argmax argmax() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. argmin argmin() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. argsort argsort() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. astype astype() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. byteswap byteswap() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. choose choose() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. clip clip() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. compress compress() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. conj conj() conjugate conjugate() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. copy copy() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. cumprod cumprod() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. cumsum cumsum() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. diagonal diagonal() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. dump dump() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. dumps dumps() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. fill fill() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. flatten flatten() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. getfield getfield() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. item item() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. itemset itemset() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. max max() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. mean mean() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. min min() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. newbyteorder newbyteorder() newbyteorder(new_order='S') Return a new dtype with a different byte order. Changes are also made in all fields and sub-arrays of the data type. The new_order code can be any from the following: 'S' - swap dtype from current to opposite endian '<', 'L'- little endian '>', 'B'- big endian '=', 'N'- native order '|', 'I'- ignore (no change to byte order) Parameters new_order : str, optional Byte order to force; a value from the byte order specifications above. The default value ('S') results in swapping the current byte order. The code does a case-insensitive check on the first letter of new_order for the alternatives above. For example, any of 'B' or 'b' or 'biggish' are valid to specify big-endian. Returns new_dtype : dtype New dtype object with the given change to the byte order. nonzero nonzero() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. prod prod() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. ptp ptp() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. put put() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. ravel ravel() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. repeat repeat() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. reshape reshape() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. resize resize() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. round round() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. searchsorted searchsorted() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. setfield setfield() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. setflags setflags() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. sort sort() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. squeeze squeeze() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. std std() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. sum sum() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. swapaxes swapaxes() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. take take() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. tobytes tobytes() tofile tofile() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. tolist tolist() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. tostring tostring() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. trace trace() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. transpose transpose() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. var var() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. view view() Not implemented (virtual attribute) Class generic exists solely to derive numpy scalars from, and possesses, albeit unimplemented, all the attributes of the ndarray class so as to provide a uniform API. See also the corresponding attribute of the derived class of interest. __abs__ __abs__() abs(self) __add__ __add__( value, / ) Return self+value. __and__ __and__( value, / ) Return self&value. __bool__ __bool__() self != 0 __eq__ __eq__( value, / ) Return self==value. __floordiv__ __floordiv__( value, / ) Return self//value. __ge__ __ge__( value, / ) Return self>=value. __getitem__ __getitem__( key, / ) Return self[key]. __gt__ __gt__( value, / ) Return self>value. __invert__ __invert__() ~self __le__ __le__( value, / ) Return self<=value. __lt__ __lt__( value, / ) Return self<value. __mod__ __mod__( value, / ) Return self%value. __mul__ __mul__( value, / ) Return self*value. __ne__ __ne__( value, / ) Return self!=value. __neg__ __neg__() -self __or__ __or__( value, / ) Return self|value. __pos__ __pos__() +self __pow__ __pow__( value, mod, / ) Return pow(self, value, mod). __radd__ __radd__( value, / ) Return value+self. __rand__ __rand__( value, / ) Return value&self. __rfloordiv__ __rfloordiv__( value, / ) Return value//self. __rmod__ __rmod__( value, / ) Return value%self. __rmul__ __rmul__( value, / ) Return value*self. __ror__ __ror__( value, / ) Return value|self. __rpow__ __rpow__( value, mod, / ) Return pow(value, self, mod). __rsub__ __rsub__( value, / ) Return value-self. __rtruediv__ __rtruediv__( value, / ) Return value/self. __rxor__ __rxor__( value, / ) Return value^self. __sub__ __sub__( value, / ) Return self-value. __truediv__ __truediv__( value, / ) Return self/value. __xor__ __xor__( value, / ) Return self^value. Class Variables T base data dtype flags flat imag itemsize nbytes ndim real shape size strides
tensorflow.experimental.numpy.complex64
tf.experimental.numpy.compress TensorFlow variant of NumPy's compress. tf.experimental.numpy.compress( condition, a, axis=None ) Unsupported arguments: out. See the NumPy documentation for numpy.compress.
tensorflow.experimental.numpy.compress
tf.experimental.numpy.concatenate TensorFlow variant of NumPy's concatenate. tf.experimental.numpy.concatenate( arys, axis=0 ) See the NumPy documentation for numpy.concatenate.
tensorflow.experimental.numpy.concatenate
tf.experimental.numpy.conj TensorFlow variant of NumPy's conj. tf.experimental.numpy.conj( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.conj.
tensorflow.experimental.numpy.conj
tf.experimental.numpy.conjugate TensorFlow variant of NumPy's conjugate. tf.experimental.numpy.conjugate( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.conjugate.
tensorflow.experimental.numpy.conjugate
tf.experimental.numpy.copy TensorFlow variant of NumPy's copy. tf.experimental.numpy.copy( a ) Unsupported arguments: order, subok. See the NumPy documentation for numpy.copy.
tensorflow.experimental.numpy.copy
tf.experimental.numpy.cos TensorFlow variant of NumPy's cos. tf.experimental.numpy.cos( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.cos.
tensorflow.experimental.numpy.cos
tf.experimental.numpy.cosh TensorFlow variant of NumPy's cosh. tf.experimental.numpy.cosh( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.cosh.
tensorflow.experimental.numpy.cosh
tf.experimental.numpy.count_nonzero TensorFlow variant of NumPy's count_nonzero. tf.experimental.numpy.count_nonzero( a, axis=None ) Unsupported arguments: keepdims. See the NumPy documentation for numpy.count_nonzero.
tensorflow.experimental.numpy.count_nonzero
tf.experimental.numpy.cross TensorFlow variant of NumPy's cross. tf.experimental.numpy.cross( a, b, axisa=-1, axisb=-1, axisc=-1, axis=None ) See the NumPy documentation for numpy.cross.
tensorflow.experimental.numpy.cross
tf.experimental.numpy.cumprod TensorFlow variant of NumPy's cumprod. tf.experimental.numpy.cumprod( a, axis=None, dtype=None ) Unsupported arguments: out. See the NumPy documentation for numpy.cumprod.
tensorflow.experimental.numpy.cumprod
tf.experimental.numpy.cumsum TensorFlow variant of NumPy's cumsum. tf.experimental.numpy.cumsum( a, axis=None, dtype=None ) Unsupported arguments: out. See the NumPy documentation for numpy.cumsum.
tensorflow.experimental.numpy.cumsum
tf.experimental.numpy.deg2rad TensorFlow variant of NumPy's deg2rad. tf.experimental.numpy.deg2rad( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.deg2rad.
tensorflow.experimental.numpy.deg2rad
tf.experimental.numpy.diag TensorFlow variant of NumPy's diag. tf.experimental.numpy.diag( v, k=0 ) Raises an error if input is not 1- or 2-d. See the NumPy documentation for numpy.diag.
tensorflow.experimental.numpy.diag
tf.experimental.numpy.diagflat TensorFlow variant of NumPy's diagflat. tf.experimental.numpy.diagflat( v, k=0 ) See the NumPy documentation for numpy.diagflat.
tensorflow.experimental.numpy.diagflat
tf.experimental.numpy.diagonal TensorFlow variant of NumPy's diagonal. tf.experimental.numpy.diagonal( a, offset=0, axis1=0, axis2=1 ) See the NumPy documentation for numpy.diagonal.
tensorflow.experimental.numpy.diagonal
tf.experimental.numpy.diag_indices TensorFlow variant of NumPy's diag_indices. tf.experimental.numpy.diag_indices( n, ndim=2 ) See the NumPy documentation for numpy.diag_indices.
tensorflow.experimental.numpy.diag_indices
tf.experimental.numpy.diff TensorFlow variant of NumPy's diff. tf.experimental.numpy.diff( a, n=1, axis=-1 ) Unsupported arguments: prepend, append. See the NumPy documentation for numpy.diff.
tensorflow.experimental.numpy.diff
tf.experimental.numpy.divide TensorFlow variant of NumPy's divide. tf.experimental.numpy.divide( x1, x2 ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.divide.
tensorflow.experimental.numpy.divide
tf.experimental.numpy.divmod TensorFlow variant of NumPy's divmod. tf.experimental.numpy.divmod( x1, x2 ) Unsupported arguments: out1, out2, out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.divmod.
tensorflow.experimental.numpy.divmod
tf.experimental.numpy.dot TensorFlow variant of NumPy's dot. tf.experimental.numpy.dot( a, b ) See the NumPy documentation for numpy.dot.
tensorflow.experimental.numpy.dot
tf.experimental.numpy.dsplit TensorFlow variant of NumPy's dsplit. tf.experimental.numpy.dsplit( ary, indices_or_sections ) See the NumPy documentation for numpy.dsplit.
tensorflow.experimental.numpy.dsplit
tf.experimental.numpy.dstack TensorFlow variant of NumPy's dstack. tf.experimental.numpy.dstack( tup ) See the NumPy documentation for numpy.dstack.
tensorflow.experimental.numpy.dstack
tf.experimental.numpy.einsum TensorFlow variant of NumPy's einsum. tf.experimental.numpy.einsum( subscripts, *operands, **kwargs ) See the NumPy documentation for numpy.einsum.
tensorflow.experimental.numpy.einsum
tf.experimental.numpy.empty TensorFlow variant of NumPy's empty. tf.experimental.numpy.empty( shape, dtype=float ) See the NumPy documentation for numpy.empty.
tensorflow.experimental.numpy.empty
tf.experimental.numpy.empty_like TensorFlow variant of NumPy's empty_like. tf.experimental.numpy.empty_like( a, dtype=None ) See the NumPy documentation for numpy.empty_like.
tensorflow.experimental.numpy.empty_like
tf.experimental.numpy.equal TensorFlow variant of NumPy's equal. tf.experimental.numpy.equal( x1, x2 ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.equal.
tensorflow.experimental.numpy.equal
tf.experimental.numpy.exp TensorFlow variant of NumPy's exp. tf.experimental.numpy.exp( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.exp.
tensorflow.experimental.numpy.exp
tf.experimental.numpy.exp2 TensorFlow variant of NumPy's exp2. tf.experimental.numpy.exp2( x ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.exp2.
tensorflow.experimental.numpy.exp2