_id
stringlengths
5
9
text
stringlengths
5
385k
title
stringclasses
1 value
doc_24100
Registers a backward hook on the module. The hook will be called every time the gradients with respect to module inputs are computed. The hook should have the following signature: hook(module, grad_input, grad_output) -> tuple(Tensor) or None The grad_input and grad_output are tuples that contain the gradients with re...
doc_24101
Convert c to an RGB color, silently dropping the alpha channel. Examples using matplotlib.colors.to_rgb List of named colors
doc_24102
Connect func as callback function to changes of the slider value. Parameters funccallable Function to call when slider is changed. The function must accept a numpy array with shape (2,) as its argument. Returns int Connection id (which can be used to disconnect func).
doc_24103
Return self>>value.
doc_24104
See Migration guide for more details. tf.compat.v1.keras.regularizers.get tf.keras.regularizers.get( identifier )
doc_24105
The base class for all built-in exceptions. It is not meant to be directly inherited by user-defined classes (for that, use Exception). If str() is called on an instance of this class, the representation of the argument(s) to the instance are returned, or the empty string when there were no arguments. args The tupl...
doc_24106
Return a random sample of items from an axis of object. You can use random_state for reproducibility. Parameters n:int, optional Number of items from axis to return. Cannot be used with frac. Default = 1 if frac = None. frac:float, optional Fraction of axis items to return. Cannot be used with n. replace:...
doc_24107
The path to the templates folder, relative to root_path, to add to the template loader. None if templates should not be added.
doc_24108
Raises a ValidationError with a code of 'max_value' if value is greater than limit_value, which may be a callable.
doc_24109
See torch.tanh()
doc_24110
Axis supplied was invalid. This is raised whenever an axis parameter is specified that is larger than the number of array dimensions. For compatibility with code written against older numpy versions, which raised a mixture of ValueError and IndexError for this situation, this exception subclasses both to ensure that ...
doc_24111
Create a recarray from a list of records in text form. Parameters recListsequence data in the same field may be heterogeneous - they will be promoted to the highest data type. dtypedata-type, optional valid dtype for all arrays shapeint or tuple of ints, optional shape of each array. formats, names, ti...
doc_24112
Translate an Internet service name and protocol name to a port number for that service. The optional protocol name, if given, should be 'tcp' or 'udp', otherwise any protocol will match. Raises an auditing event socket.getservbyname with arguments servicename, protocolname.
doc_24113
Werkzeug implements WSGI, the standard Python interface between applications and servers. Jinja is a template language that renders the pages your application serves. MarkupSafe comes with Jinja. It escapes untrusted input when rendering templates to avoid injection attacks. ItsDangerous securely signs data to ensur...
doc_24114
Register subclass as a “virtual subclass” of this ABC. For example: from abc import ABC class MyABC(ABC): pass MyABC.register(tuple) assert issubclass(tuple, MyABC) assert isinstance((), MyABC) Changed in version 3.3: Returns the registered subclass, to allow usage as a class decorator. Changed in version 3....
doc_24115
If matching the URL failed, this is the exception that will be raised / was raised as part of the request handling. This is usually a NotFound exception or something similar.
doc_24116
tf.math.confusion_matrix( labels, predictions, num_classes=None, weights=None, dtype=tf.dtypes.int32, name=None ) The matrix columns represent the prediction labels and the rows represent the real labels. The confusion matrix is always a 2-D array of shape [n, n], where n is the number of valid labels for a gi...
doc_24117
Applies fn recursively to every submodule (as returned by .children()) as well as self. Typical use includes initializing the parameters of a model (see also torch.nn.init). Parameters fn (Module -> None) – function to be applied to each submodule Returns self Return type Module Example: >>> @torch.no_grad() >>...
doc_24118
Set the SubplotSpec instance.
doc_24119
Return the Figure instance the artist belongs to.
doc_24120
Test whether the filename string matches the pattern string, returning True or False. Both parameters are case-normalized using os.path.normcase(). fnmatchcase() can be used to perform a case-sensitive comparison, regardless of whether that’s standard for the operating system. This example will print all file names in ...
doc_24121
If you are running an entropy-gathering daemon (EGD) somewhere, and path is the pathname of a socket connection open to it, this will read 256 bytes of randomness from the socket, and add it to the SSL pseudo-random number generator to increase the security of generated secret keys. This is typically only necessary on ...
doc_24122
Predict class probabilities for X. The predicted class probabilities of an input sample are computed as the mean predicted class probabilities of the trees in the forest. The class probability of a single tree is the fraction of samples of the same class in a leaf. Parameters X{array-like, sparse matrix} of shape...
doc_24123
Returns the matrix raised to the power n for square matrices. For batch of matrices, each individual matrix is raised to the power n. If n is negative, then the inverse of the matrix (if invertible) is raised to the power n. For a batch of matrices, the batched inverse (if invertible) is raised to the power n. If n is ...
doc_24124
[Deprecated] Notes Deprecated since version 3.5:
doc_24125
Return a Series/DataFrame with absolute numeric value of each element. This function only applies to elements that are all numeric. Returns abs Series/DataFrame containing the absolute value of each element. See also numpy.absolute Calculate the absolute value element-wise. Notes For complex inputs, 1.2...
doc_24126
See Migration guide for more details. tf.compat.v1.feature_column.embedding_column tf.feature_column.embedding_column( categorical_column, dimension, combiner='mean', initializer=None, ckpt_to_load_from=None, tensor_name_in_ckpt=None, max_norm=None, trainable=True, use_safe_embedding_lookup=True ) Use th...
doc_24127
See Migration guide for more details. tf.compat.v1.repeat tf.repeat( input, repeats, axis=None, name=None ) See also tf.concat, tf.stack, tf.tile. Args input An N-dimensional Tensor. repeats An 1-D int Tensor. The number of repetitions for each element. repeats is broadcasted to fit the shape of t...
doc_24128
Manually clean up the data in the locals for this context. Call this at the end of the request or use make_middleware(). Return type None
doc_24129
Roll provided date forward to next offset only if not on offset. Returns TimeStamp Rolled timestamp if not on offset, otherwise unchanged timestamp.
doc_24130
Alias for set_linewidth.
doc_24131
Return True if the queue is empty, False otherwise.
doc_24132
Bases: matplotlib.blocking_input.BlockingInput Callable for retrieving mouse clicks in a blocking way. This class will also retrieve keypresses and map them to mouse clicks: delete and backspace are a right click, enter is like a middle click, and all others are like a left click. add_click(event)[source] Add the...
doc_24133
Time of most recent content modification expressed in seconds.
doc_24134
Return the clip path.
doc_24135
Closes all files. If you put real file objects into the files dict you can call this method to automatically close them all in one go. Return type None
doc_24136
Remove (delete) the directory path. If the directory does not exist or is not empty, an FileNotFoundError or an OSError is raised respectively. In order to remove whole directory trees, shutil.rmtree() can be used. This function can support paths relative to directory descriptors. Raises an auditing event os.rmdir with...
doc_24137
Casts all parameters and buffers to dst_type. Parameters dst_type (type or string) – the desired type Returns self Return type Module
doc_24138
Finally send the headers to the output stream and flush the internal headers buffer. New in version 3.3.
doc_24139
See torch.mode()
doc_24140
The .. mathmpl:: directive, as documented in the module's docstring.
doc_24141
Append the last nelements items of history to a file. The default filename is ~/.history. The file must already exist. This calls append_history() in the underlying library. This function only exists if Python was compiled for a version of the library that supports it. New in version 3.5.
doc_24142
Return the month names of the DateTimeIndex with specified locale. Parameters locale:str, optional Locale determining the language in which to return the month name. Default is English locale. Returns Index Index of month names. Examples >>> idx = pd.date_range(start='2018-01', freq='M', periods=3) >...
doc_24143
Get tree status. Returns tree_stats: tuple of int (number of trims, number of leaves, number of splits)
doc_24144
Closes the PixelArray, and releases Surface lock. transpose() -> PixelArray This method is for explicitly closing the PixelArray, and releasing a lock on the Suface. New in pygame 1.9.4.
doc_24145
Context manager for floating-point error handling. Using an instance of errstate as a context manager allows statements in that context to execute with a known error handling behavior. Upon entering the context the error handling is set with seterr and seterrcall, and upon exiting it is reset to what it was before. ...
doc_24146
Create and return a new database name, initialize it with schema, and set the properties ProductName, ProductCode, ProductVersion, and Manufacturer. schema must be a module object containing tables and _Validation_records attributes; typically, msilib.schema should be used. The database will contain just the schema and...
doc_24147
See Migration guide for more details. tf.compat.v1.raw_ops.BesselK1 tf.raw_ops.BesselK1( x, name=None ) Args x A Tensor. Must be one of the following types: bfloat16, half, float32, float64. name A name for the operation (optional). Returns A Tensor. Has the same type as x.
doc_24148
A reference to the array that is iterated over. Examples >>> x = np.arange(5) >>> fl = x.flat >>> fl.base is x True
doc_24149
Returns the sum of the elements of the diagonal of the input 2-D matrix. Example: >>> x = torch.arange(1., 10.).view(3, 3) >>> x tensor([[ 1., 2., 3.], [ 4., 5., 6.], [ 7., 8., 9.]]) >>> torch.trace(x) tensor(15.)
doc_24150
Calculate slice bound that corresponds to given label. Returns leftmost (one-past-the-rightmost if side=='right') position of given label. Parameters label:object side:{‘left’, ‘right’} kind:{‘loc’, ‘getitem’} or None Deprecated since version 1.4.0. Returns int Index of label.
doc_24151
Get the mapping of live local variables in generator to their current values. A dictionary is returned that maps from variable names to values. This is the equivalent of calling locals() in the body of the generator, and all the same caveats apply. If generator is a generator with no currently associated frame, then an...
doc_24152
Deprecated and no longer used.
doc_24153
Return a ctypes object allocated from shared memory which is a copy of the ctypes object obj.
doc_24154
PostgreSQL specific aggregation functions General-purpose aggregation functions Aggregate functions for statistics Usage examples PostgreSQL specific database constraints ExclusionConstraint PostgreSQL specific query expressions ArraySubquery() expressions PostgreSQL specific model fields Indexing these fields...
doc_24155
'DEFAULT_PARSER_CLASSES': [ 'rest_framework.parsers.JSONParser', ] } You can also set the parsers used for an individual view, or viewset, using the APIView class-based views. from rest_framework.parsers import JSONParser from rest_framework.response import Response from rest_framework.views import API...
doc_24156
Bases: object A class that converts strings to paths. DPI=72 FONT_SCALE=100.0 get_glyphs_mathtext(prop, s, glyph_map=None, return_new_glyphs_only=False)[source] Parse mathtext string s and convert it to a (vertices, codes) pair. get_glyphs_tex(prop, s, glyph_map=None, return_new_glyphs_only=False)[sou...
doc_24157
Bases: matplotlib.backend_managers.ToolEvent Event to inform that a tool has been triggered.
doc_24158
See Migration guide for more details. tf.compat.v1.compat.as_text tf.compat.as_text( bytes_or_text, encoding='utf-8' ) Returns the input as a unicode string. Uses utf-8 encoding for text by default. Args bytes_or_text A bytes, str, or unicode object. encoding A string indicating the charset for de...
doc_24159
Returns a new tensor with the exponential of the elements of the input tensor input. yi=exiy_{i} = e^{x_{i}} Parameters input (Tensor) – the input tensor. Keyword Arguments out (Tensor, optional) – the output tensor. Example: >>> torch.exp(torch.tensor([0, math.log(2.)])) tensor([ 1., 2.])
doc_24160
Join adjacent text nodes so that all stretches of text are stored as single Text instances. This simplifies processing text from a DOM tree for many applications.
doc_24161
Set the CapStyle for the collection (for all its elements). Parameters csCapStyle or {'butt', 'projecting', 'round'}
doc_24162
Scale features using statistics that are robust to outliers. This Scaler removes the median and scales the data according to the quantile range (defaults to IQR: Interquartile Range). The IQR is the range between the 1st quartile (25th quantile) and the 3rd quartile (75th quantile). Centering and scaling happen indep...
doc_24163
Return a copy of the string with the leading and trailing characters removed. The chars argument is a string specifying the set of characters to be removed. If omitted or None, the chars argument defaults to removing whitespace. The chars argument is not a prefix or suffix; rather, all combinations of its values are st...
doc_24164
os.RTLD_NOW os.RTLD_GLOBAL os.RTLD_LOCAL os.RTLD_NODELETE os.RTLD_NOLOAD os.RTLD_DEEPBIND Flags for use with the setdlopenflags() and getdlopenflags() functions. See the Unix manual page dlopen(3) for what the different flags mean. New in version 3.3.
doc_24165
Return a byte representation of the message corresponding to key, or raise a KeyError exception if no such message exists. New in version 3.2.
doc_24166
Color the text in a gradient style. The text color is determined according to the data in each column, row or frame, or by a given gradient map. Requires matplotlib. Parameters cmap:str or colormap Matplotlib colormap. low:float Compress the color range at the low end. This is a multiple of the data range t...
doc_24167
Return the name of the (text or binary) file in which an object was defined. This will fail with a TypeError if the object is a built-in module, class, or function.
doc_24168
Return log-probability estimates for the test vector X. Parameters Xarray-like of shape (n_samples, n_features) Returns Carray-like of shape (n_samples, n_classes) Returns the log-probability of the samples for each class in the model. The columns correspond to the classes in sorted order, as they appear ...
doc_24169
Convenience method for simple axis view autoscaling. See matplotlib.axes.Axes.autoscale() for full explanation. Note that this function behaves the same, but for all three axes. Therefore, 'z' can be passed for axis, and 'both' applies to all three axes.
doc_24170
class sklearn.linear_model.HuberRegressor(*, epsilon=1.35, max_iter=100, alpha=0.0001, warm_start=False, fit_intercept=True, tol=1e-05) [source] Linear regression model that is robust to outliers. The Huber Regressor optimizes the squared loss for the samples where |(y - X'w) / sigma| < epsilon and the absolute loss ...
doc_24171
[Deprecated] Convert UNIX time to days since Matplotlib epoch. Parameters elist of floats Time in seconds since 1970-01-01. Returns numpy.array Time in days since Matplotlib epoch (see get_epoch()). Notes Deprecated since version 3.5.
doc_24172
word will usually be a user’s password as typed at a prompt or in a graphical interface. The optional salt is either a string as returned from mksalt(), one of the crypt.METHOD_* values (though not all may be available on all platforms), or a full encrypted password including salt, as returned by this function. If salt...
doc_24173
See Migration guide for more details. tf.compat.v1.nn.ctc_unique_labels tf.nn.ctc_unique_labels( labels, name=None ) For use with tf.nn.ctc_loss optional argument unique: This op can be used to preprocess labels in input pipeline to for better speed/memory use computing the ctc loss on TPU. Example: ctc_unique_l...
doc_24174
A subclass of SSLError raised when trying to read or write and the SSL connection has been closed cleanly. Note that this doesn’t mean that the underlying transport (read TCP) has been closed. New in version 3.3.
doc_24175
See Migration guide for more details. tf.compat.v1.raw_ops.Lu tf.raw_ops.Lu( input, output_idx_type=tf.dtypes.int32, name=None ) The input is a tensor of shape [..., M, M] whose inner-most 2 dimensions form square matrices. The input has to be invertible. The output consists of two tensors LU and P containing th...
doc_24176
Compare images generated by the test with those specified in baseline_images, which must correspond, else an ImageComparisonFailure exception will be raised. Parameters baseline_imageslist or None A list of strings specifying the names of the images generated by calls to Figure.savefig. If None, the test functi...
doc_24177
Assert that running the interpreter with args and optional environment variables env_vars fails (rc != 0) and return a (return code, stdout, stderr) tuple. See assert_python_ok() for more options. Changed in version 3.9: The function no longer strips whitespaces from stderr.
doc_24178
Trim values at input threshold(s). Assigns values outside boundary to boundary values. Thresholds can be singular values or array like, and in the latter case the clipping is performed element-wise in the specified axis. Parameters lower:float or array-like, default None Minimum threshold value. All values belo...
doc_24179
Refines the dimension names of self according to names. Refining is a special case of renaming that “lifts” unnamed dimensions. A None dim can be refined to have any name; a named dim can only be refined to have the same name. Because named tensors can coexist with unnamed tensors, refining names gives a nice way to ...
doc_24180
Open a grouping element with label s and gid (if set) as id. Only used by the SVG renderer.
doc_24181
Identity function. If p is the returned series, then p(x) == x for all values of x. Parameters domain{None, array_like}, optional If given, the array must be of the form [beg, end], where beg and end are the endpoints of the domain. If None is given then the class domain is used. The default is None. window{N...
doc_24182
Function to be used to compare method names when sorting them in getTestCaseNames() and all the loadTestsFrom*() methods.
doc_24183
See Migration guide for more details. tf.compat.v1.raw_ops.BatchMatMulV2 tf.raw_ops.BatchMatMulV2( x, y, adj_x=False, adj_y=False, name=None ) Multiplies all slices of Tensor x and y (each slice can be viewed as an element of a batch), and arranges the individual results in a single output tensor of the same bat...
doc_24184
tf.strings.reduce_join( inputs, axis=None, keepdims=False, separator='', name=None ) tf.strings.reduce_join([['abc','123'], ['def','456']]).numpy() b'abc123def456' tf.strings.reduce_join([['abc','123'], ['def','456']], axis=-1).numpy() array([b'abc123', b'def456'], ...
doc_24185
tf.experimental.numpy.multiply( x1, x2 ) Unsupported arguments: out, where, casting, order, dtype, subok, signature, extobj. See the NumPy documentation for numpy.multiply.
doc_24186
Implements Adamax algorithm (a variant of Adam based on infinity norm). It has been proposed in Adam: A Method for Stochastic Optimization. Parameters params (iterable) – iterable of parameters to optimize or dicts defining parameter groups lr (float, optional) – learning rate (default: 2e-3) betas (Tuple[float...
doc_24187
This key is not used in versions of Windows after 98.
doc_24188
Multiply one Legendre series by another. Returns the product of two Legendre series c1 * c2. The arguments are sequences of coefficients, from lowest order “term” to highest, e.g., [1,2,3] represents the series P_0 + 2*P_1 + 3*P_2. Parameters c1, c2array_like 1-D arrays of Legendre series coefficients ordered f...
doc_24189
Exception raised for errors that are related to the database.
doc_24190
Return a repr of dict with keys sorted.
doc_24191
This method allows you to compare two Charset instances for equality.
doc_24192
See Migration guide for more details. tf.compat.v1.raw_ops.Pad tf.raw_ops.Pad( input, paddings, name=None ) This operation pads a input with zeros according to the paddings you specify. paddings is an integer tensor with shape [Dn, 2], where n is the rank of input. For each dimension D of input, paddings[D, 0] i...
doc_24193
tf.compat.v1.lite.toco_convert( input_data, input_tensors, output_tensors, *args, **kwargs ) Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use lite.TFLiteConverter instead. Typically this function is used to convert from TensorFlow GraphDef to TFLite. Conv...
doc_24194
The transposed array. Same as self.transpose(). See also transpose Examples >>> x = np.array([[1.,2.],[3.,4.]]) >>> x array([[ 1., 2.], [ 3., 4.]]) >>> x.T array([[ 1., 3.], [ 2., 4.]]) >>> x = np.array([1.,2.,3.,4.]) >>> x array([ 1., 2., 3., 4.]) >>> x.T array([ 1., 2., 3., 4.])
doc_24195
See Migration guide for more details. tf.compat.v1.raw_ops.OrderedMapUnstage tf.raw_ops.OrderedMapUnstage( key, indices, dtypes, capacity=0, memory_limit=0, container='', shared_name='', name=None ) from the underlying container. If the underlying container does not contain this key, the op will block until ...
doc_24196
See Migration guide for more details. tf.compat.v1.raw_ops.BatchToSpaceND tf.raw_ops.BatchToSpaceND( input, block_shape, crops, name=None ) This operation reshapes the "batch" dimension 0 into M + 1 dimensions of shape block_shape + [batch], interleaves these blocks back into the grid defined by the spatial dime...
doc_24197
Alias for get_linestyle.
doc_24198
Raised when a specified range of text does not fit into a string. This is not known to be used in the Python DOM implementations, but may be received from DOM implementations not written in Python.
doc_24199
Predict multi-output variable using a model trained for each target variable. Parameters X{array-like, sparse matrix} of shape (n_samples, n_features) Data. Returns y{array-like, sparse matrix} of shape (n_samples, n_outputs) Multi-output targets predicted across multiple predictors. Note: Separate ...