Unsigned integer type, compatible with C unsigned long.
Character code: 'L'. Canonical name: np.uint. Alias on this platform: np.uint64: 64-bit unsigned integer (0 to 18446744073709551615). Alias on this platform: np.uintp: Unsigned integer large enough to fit pointer, compatible with C uintptr_t.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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(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:
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.
new_dtype : dtype New dtype object with the given change to the byte order.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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(self)
Return self+value.
Return self&value.
self != 0
Return self==value.
Return self//value.
Return self>=value.
Return self[key].
Return self>value.
~self
Return self<=value.
Return self<value.
Return self%value.
Return self*value.
Return self!=value.
-self
Return self|value.
+self
Return pow(self, value, mod).
Return value+self.
Return value&self.
Return value//self.
Return value%self.
Return value*self.
Return value|self.
Return pow(value, self, mod).
Return value-self.
Return value/self.
Return value^self.
Return self-value.
Return self/value.
Return self^value.


Unsigned integer type, compatible with C unsigned char.
Character code: 'B'. Canonical name: np.ubyte. Alias on this platform: np.uint8: 8-bit unsigned integer (0 to 255).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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(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:
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.
new_dtype : dtype New dtype object with the given change to the byte order.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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(self)
Return self+value.
Return self&value.
self != 0
Return self==value.
Return self//value.
Return self>=value.
Return self[key].
Return self>value.
~self
Return self<=value.
Return self<value.
Return self%value.
Return self*value.
Return self!=value.
-self
Return self|value.
+self
Return pow(self, value, mod).
Return value+self.
Return value&self.
Return value//self.
Return value%self.
Return value*self.
Return value|self.
Return pow(value, self, mod).
Return value-self.
Return value/self.
Return value^self.
Return self-value.
Return self/value.
Return self^value.


str(object='') -> str
str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
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.
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.
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.
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.
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.
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.
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.
Return a capitalized version of the string.
More specifically, make the first character have upper case and the rest lower case.
Return a version of the string suitable for caseless comparisons.
Return a centered string of length width.
Padding is done using the specified fill character (default is a space).
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.
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.
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.
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.
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.
S.count(sub[, start[, end]]) -> int
Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.
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.
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.
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.
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.
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.
Encode the string using the codec registered for encoding.
encoding The encoding in which to encode the string. errors The error handling scheme to use for encoding errors. The default is 'strict' meaning that encoding errors raise a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and 'xmlcharrefreplace' as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.
S.endswith(suffix[, start[, end]]) -> bool
Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.
Return a copy where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
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.
S.find(sub[, start[, end]]) -> int
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
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.
S.format(*args, **kwargs) -> str
Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces ('{' and '}').
S.format_map(mapping) -> str
Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces ('{' and '}').
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.
S.index(sub[, start[, end]]) -> int
Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
Return True if the string is an alpha-numeric string, False otherwise.
A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.
Return True if the string is an alphabetic string, False otherwise.
A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.
Return True if all characters in the string are ASCII, False otherwise.
ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.
Return True if the string is a decimal string, False otherwise.
A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.
Return True if the string is a digit string, False otherwise.
A string is a digit string if all characters in the string are digits and there is at least one character in the string.
Return True if the string is a valid Python identifier, False otherwise.
Use keyword.iskeyword() to test for reserved identifiers such as "def" and "class".
Return True if the string is a lowercase string, False otherwise.
A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at least one character in the string.
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are considered printable in repr() or if it is empty.
Return True if the string is a whitespace string, False otherwise.
A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.
Return True if the string is a title-cased string, False otherwise.
In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.
Return True if the string is an uppercase string, False otherwise.
A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.
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.
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.
Concatenate any number of strings.
The string whose method is called is inserted in between each given string. The result is returned as a new string.
Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs'
Return a left-justified string of length width.
Padding is done using the specified fill character (default is a space).
Return a copy of the string converted to lowercase.
Return a copy of the string with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.
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.
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.
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(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:
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.
new_dtype : dtype New dtype object with the given change to the byte order.
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.
Partition the string into three parts using the given separator.
This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing the original string and two empty strings.
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.
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.
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.
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.
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.
Return a copy with all occurrences of substring old replaced by new.
count Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.
If the optional argument count is given, only the first count occurrences are replaced.
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.
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.
S.rfind(sub[, start[, end]]) -> int
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Return -1 on failure.
S.rindex(sub[, start[, end]]) -> int
Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
Return a right-justified string of length width.
Padding is done using the specified fill character (default is a space).
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.
Partition the string into three parts using the given separator.
This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.
If the separator is not found, returns a 3-tuple containing two empty strings and the original string.
Return a list of the words in the string, using sep as the delimiter string.
sep The delimiter according which to split the string. None (the default value) means split according to any whitespace, and discard empty strings from the result. maxsplit Maximum number of splits to do. -1 (the default value) means no limit.
Splits are done starting at the end of the string and working to the front.
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
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.
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.
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.
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.
Return a list of the words in the string, using sep as the delimiter string.
sep The delimiter according which to split the string. None (the default value) means split according to any whitespace, and discard empty strings from the result. maxsplit Maximum number of splits to do. -1 (the default value) means no limit.
Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and true.
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.
S.startswith(prefix[, start[, end]]) -> bool
Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.
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.
Return a copy of the string with leading and trailing whitespace remove.
If chars is given and not None, remove characters in chars instead.
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.
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.
Convert uppercase characters to lowercase and lowercase characters to uppercase.
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.
Return a version of the string where each word is titlecased.
More specifically, words start with uppercased characters and all remaining cased characters have lower case.
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.
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.
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.
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.
Replace each character in the string using the given translation table.
table Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.
The table must implement lookup/indexing via getitem, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.
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.
Return a copy of the string converted to uppercase.
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.
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.
Pad a numeric string with zeros on the left, to fill a field of the given width.
The string is never truncated.
abs(self)
Return self+value.
Return self&value.
self != 0
Return key in self.
Return self==value.
Return self//value.
Return self>=value.
Return self[key].
Return self>value.
~self
Implement iter(self).
Return self<=value.
Return len(self).
Return self<value.
Return self%value.
Return self*value.
Return self!=value.
-self
Return self|value.
+self
Return pow(self, value, mod).
Return value+self.
Return value&self.
Return value//self.
Return value%self.
Return value*self.
Return value|self.
Return pow(value, self, mod).
Return value-self.
Return value/self.
Return value^self.
Return self-value.
Return self/value.
Return self^value.


TensorFlow variant of NumPy's vander.
See the NumPy documentation for numpy.vander.


TensorFlow variant of NumPy's var.
See the NumPy documentation for numpy.var.


TensorFlow variant of NumPy's vdot.
See the NumPy documentation for numpy.vdot.


TensorFlow variant of NumPy's vsplit.
See the NumPy documentation for numpy.vsplit.


TensorFlow variant of NumPy's vstack.
See the NumPy documentation for numpy.vstack.


TensorFlow variant of NumPy's where.
Raises ValueError if exactly one of x or y is not None.
See the NumPy documentation for numpy.where.


TensorFlow variant of NumPy's zeros.
See the NumPy documentation for numpy.zeros.


TensorFlow variant of NumPy's zeros_like.
Unsupported arguments: order, subok, shape.
See the NumPy documentation for numpy.zeros_like.


Represents a value that may or may not be present.
Main aliases
tf.data.experimental.Optional
See Migration guide for more details.
tf.compat.v1.data.experimental.Optional, tf.compat.v1.experimental.Optional
A tf.experimental.Optional can represent the result of an operation that may fail as a value, rather than raising an exception and halting execution. For example, tf.data.Iterator.get_next_as_optional() returns a tf.experimental.Optional that either contains the next element of an iterator if one exists, or an "empty" value that indicates the end of the sequence has been reached.
tf.experimental.Optional can only be used with values that are convertible to tf.Tensor or tf.CompositeTensor.
One can create a tf.experimental.Optional from a value using the from_value() method:
or without a value using the empty() method:
View source
Returns an Optional that has no value.
View source
Returns a tf.experimental.Optional that wraps the given value.
View source
Returns the value wrapped by this optional.
If this optional does not have a value (i.e. self.has_value() evaluates to False), this operation will raise tf.errors.InvalidArgumentError at runtime.
View source
Returns a tensor that evaluates to True if this optional has a value.


Loads a TensorFlow FileSystem plugin.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.experimental.register_filesystem_plugin


Public API for tf.experimental.tensorrt namespace.
class ConversionParams: Parameters that are used for TF-TRT conversion.
class Converter: An offline converter for TF-TRT transformation for TF 2.0 SavedModels.


Parameters that are used for TF-TRT conversion.


An offline converter for TF-TRT transformation for TF 2.0 SavedModels.
Currently this is not available on Windows platform.
Note that in V2, is_dynamic_op=False is not supported, meaning TRT engines will be built only when the corresponding TRTEngineOp is executed. But we still provide a way to avoid the cost of building TRT engines during inference (see more below).
There are several ways to run the conversion:
FP32/FP16 precision
In this case, no TRT engines will be built or saved in the converted SavedModel. But if input data is available during conversion, we can still build and save the TRT engines to reduce the cost during inference (see option 2 below).
FP32/FP16 precision with pre-built engines
In this way, one engine will be built/saved for each unique input shapes of the TRTEngineOp. This is good for applications that cannot afford building engines during inference but have access to input data that is similar to the one used in production (for example, that has the same input shapes). Also, the generated TRT engines is platform dependent, so we need to run build() in an environment that is similar to production (e.g. with same type of GPU).
INT8 precision and calibration with pre-built engines
View source
Run inference with converted graph in order to build TensorRT engines.
input_shapes = [[(1, 16), (2, 16)], # 1st input list [(2, 32), (4, 32)], # 2nd list of two tensors [(4, 32), (8, 32)]] # 3rd input list for shapes in input_shapes:
yield [np.zeros(x).astype(np.float32) for x in shapes]`
View source
Convert the input SavedModel in 2.0 format.
View source
Save the converted SavedModel.


Extract patches from input and put them in the "depth" output dimension. 3D extension of extract_image_patches.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.extract_volume_patches
The size-related attributes are specified as follows:


Construct an identity matrix, or a batch of matrices.
Main aliases
tf.linalg.eye
See Migration guide for more details.
tf.compat.v1.eye, tf.compat.v1.linalg.eye
See also tf.ones, tf.zeros, tf.fill, tf.one_hot.


Public API for tf.feature_column namespace.
bucketized_column(...): Represents discretized dense input bucketed by boundaries.
categorical_column_with_hash_bucket(...): Represents sparse feature where ids are set by hashing.
categorical_column_with_identity(...): A CategoricalColumn that returns identity values.
categorical_column_with_vocabulary_file(...): A CategoricalColumn with a vocabulary file.
categorical_column_with_vocabulary_list(...): A CategoricalColumn with in-memory vocabulary.
crossed_column(...): Returns a column for performing crosses of categorical features.
embedding_column(...): DenseColumn that converts from sparse, categorical input.
indicator_column(...): Represents multi-hot representation of given categorical column.
make_parse_example_spec(...): Creates parsing spec dictionary from input feature_columns.
numeric_column(...): Represents real valued or numerical features.
sequence_categorical_column_with_hash_bucket(...): A sequence of categorical terms where ids are set by hashing.
sequence_categorical_column_with_identity(...): Returns a feature column that represents sequences of integers.
sequence_categorical_column_with_vocabulary_file(...): A sequence of categorical terms where ids use a vocabulary file.
sequence_categorical_column_with_vocabulary_list(...): A sequence of categorical terms where ids use an in-memory list.
sequence_numeric_column(...): Returns a feature column that represents sequences of numeric data.
shared_embeddings(...): List of dense columns that convert from sparse, categorical input.
weighted_categorical_column(...): Applies weight values to a CategoricalColumn.


Represents discretized dense input bucketed by boundaries.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.bucketized_column
Buckets include the left boundary, and exclude the right boundary. Namely, boundaries=[0., 1., 2.] generates buckets (-inf, 0.), [0., 1.), [1., 2.), and [2., +inf).
For example, if the inputs are
then the output will be
A bucketized_column can also be crossed with another categorical column using crossed_column:


Represents sparse feature where ids are set by hashing.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.categorical_column_with_hash_bucket
Use this when your sparse features are in string or integer format, and you want to distribute your inputs into a finite number of buckets by hashing. output_id = Hash(input_feature_string) % bucket_size for string type input. For int type input, the value is converted to its string representation first and then hashed by the same formula.
For input dictionary features, features[key] is either Tensor or SparseTensor. If Tensor, missing values can be represented by -1 for int and '' for string, which will be dropped by this feature column.


A CategoricalColumn that returns identity values.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.categorical_column_with_identity
Use this when your inputs are integers in the range [0, num_buckets), and you want to use the input value itself as the categorical ID. Values outside this range will result in default_value if specified, otherwise it will fail.
Typically, this is used for contiguous ranges of integer indexes, but it doesn't have to be. This might be inefficient, however, if many of IDs are unused. Consider categorical_column_with_hash_bucket in that case.
For input dictionary features, features[key] is either Tensor or SparseTensor. If Tensor, missing values can be represented by -1 for int and '' for string, which will be dropped by this feature column.
In the following examples, each input in the range [0, 1000000) is assigned the same value. All other inputs are assigned default_value 0. Note that a literal 0 in inputs will result in the same default ID.
Embedding for a DNN model:


A CategoricalColumn with a vocabulary file.
Use this when your inputs are in string or integer format, and you have a vocabulary file that maps each value to an integer ID. By default, out-of-vocabulary values are ignored. Use either (but not both) of num_oov_buckets and default_value to specify how to include out-of-vocabulary values.
For input dictionary features, features[key] is either Tensor or SparseTensor. If Tensor, missing values can be represented by -1 for int and '' for string, which will be dropped by this feature column.
Example with num_oov_buckets: File '/us/states.txt' contains 50 lines, each with a 2-character U.S. state abbreviation. All inputs with values in that file are assigned an ID 0-49, corresponding to its line number. All other values are hashed and assigned an ID 50-54.
Example with default_value: File '/us/states.txt' contains 51 lines - the first line is 'XX', and the other 50 each have a 2-character U.S. state abbreviation. Both a literal 'XX' in input, and other values missing from the file, will be assigned ID 0. All others are assigned the corresponding line number 1-50.
And to make an embedding with either:


A CategoricalColumn with in-memory vocabulary.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.categorical_column_with_vocabulary_list
Use this when your inputs are in string or integer format, and you have an in-memory vocabulary mapping each value to an integer ID. By default, out-of-vocabulary values are ignored. Use either (but not both) of num_oov_buckets and default_value to specify how to include out-of-vocabulary values.
For input dictionary features, features[key] is either Tensor or SparseTensor. If Tensor, missing values can be represented by -1 for int and '' for string, which will be dropped by this feature column.
Example with num_oov_buckets: In the following example, each input in vocabulary_list is assigned an ID 0-3 corresponding to its index (e.g., input 'B' produces output 2). All other inputs are hashed and assigned an ID 4-5.
Example with default_value: In the following example, each input in vocabulary_list is assigned an ID 0-4 corresponding to its index (e.g., input 'B' produces output 3). All other inputs are assigned default_value 0.
And to make an embedding with either:


Returns a column for performing crosses of categorical features.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.crossed_column
Crossed features will be hashed according to hash_bucket_size. Conceptually, the transformation can be thought of as: Hash(cartesian product of features) % hash_bucket_size
For example, if the input features are:
SparseTensor referred by first key:
SparseTensor referred by second key:
then crossed feature will look like:
Here is an example to create a linear model with crosses of string features:
You could also use vocabulary lookup before crossing:
If an input feature is of numeric type, you can use categorical_column_with_identity, or bucketized_column, as in the example:
To use crossed column in DNN model, you need to add it in an embedding column as in this example:


DenseColumn that converts from sparse, categorical input.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.embedding_column
Use this when your inputs are sparse, but you want to convert them to a dense representation (e.g., to feed to a DNN).
Inputs must be a CategoricalColumn created by any of the categorical_column_* function. Here is an example of using embedding_column with DNNClassifier:
Here is an example using embedding_column with model_fn:


Represents multi-hot representation of given categorical column.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.indicator_column
For DNN model, indicator_column can be used to wrap any categorical_column_* (e.g., to feed to DNN). Consider to Use embedding_column if the number of buckets/unique(values) are large.
For Wide (aka linear) model, indicator_column is the internal representation for categorical column when passing categorical column directly (as any element in feature_columns) to linear_model. See linear_model for details.


Creates parsing spec dictionary from input feature_columns.
The returned dictionary can be used as arg 'features' in tf.io.parse_example.
For the above example, make_parse_example_spec would return the dict:


Represents real valued or numerical features.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.numeric_column


A sequence of categorical terms where ids are set by hashing.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.sequence_categorical_column_with_hash_bucket
Pass this to embedding_column or indicator_column to convert sequence categorical data into dense representation for input to sequence NN, such as RNN.


Returns a feature column that represents sequences of integers.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.sequence_categorical_column_with_identity
Pass this to embedding_column or indicator_column to convert sequence categorical data into dense representation for input to sequence NN, such as RNN.


A sequence of categorical terms where ids use a vocabulary file.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.sequence_categorical_column_with_vocabulary_file
Pass this to embedding_column or indicator_column to convert sequence categorical data into dense representation for input to sequence NN, such as RNN.


A sequence of categorical terms where ids use an in-memory list.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.sequence_categorical_column_with_vocabulary_list
Pass this to embedding_column or indicator_column to convert sequence categorical data into dense representation for input to sequence NN, such as RNN.


Returns a feature column that represents sequences of numeric data.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.sequence_numeric_column


List of dense columns that convert from sparse, categorical input.
This is similar to embedding_column, except that it produces a list of embedding columns that share the same embedding weights.
Use this when your inputs are sparse and of the same type (e.g. watched and impression video IDs that share the same vocabulary), and you want to convert them to a dense representation (e.g., to feed to a DNN).
Inputs must be a list of categorical columns created by any of the categorical_column_* function. They must all be of the same type and have the same arguments except key. E.g. they can be categorical_column_with_vocabulary_file with the same vocabulary_file. Some or all columns could also be weighted_categorical_column.
Here is an example embedding of two features for a DNNClassifier model:
Here is an example using shared_embedding_columns with model_fn:


Applies weight values to a CategoricalColumn.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.feature_column.weighted_categorical_column
Use this when each of your sparse inputs has both an ID and a value. For example, if you're representing text documents as a collection of word frequencies, you can provide 2 parallel sparse input features ('terms' and 'frequencies' below).
Input tf.Example objects:
This assumes the input dictionary contains a SparseTensor for key 'terms', and a SparseTensor for key 'frequencies'. These 2 tensors must have the same indices and dense shape.


Creates a tensor filled with a scalar value.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.fill
See also tf.ones, tf.zeros, tf.one_hot, tf.eye.
This operation creates a tensor of shape dims and fills it with value.
tf.fill evaluates at graph runtime and supports dynamic shapes based on other runtime tf.Tensors, unlike tf.constant(value, shape=dims), which embeds the value as a Const node.
Similar to np.full. In numpy, more parameters are supported. Passing a number argument as the shape (np.full(5, value)) is valid in numpy for specifying a 1-D shaped result, while TensorFlow does not support this syntax.


Generates fingerprint values.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.fingerprint
Generates fingerprint values of data.
Fingerprint op considers the first dimension of data as the batch dimension, and output[i] contains the fingerprint value generated from contents in data[i, ...] for all i.
Fingerprint op writes fingerprint values as byte arrays. For example, the default method farmhash64 generates a 64-bit fingerprint value at a time. This 8-byte value is written out as an tf.uint8 array of size 8, in little-endian order.
For example, suppose that data has data type tf.int32 and shape (2, 3, 4), and that the fingerprint method is farmhash64. In this case, the output shape is (2, 8), where 2 is the batch dimension size of data, and 8 is the size of each fingerprint value in bytes. output[0, :] is generated from 12 integers in data[0, :, :] and similarly output[1, :] is generated from other 12 integers in data[1, :, :].
Note that this op fingerprints the raw underlying buffer, and it does not fingerprint Tensor's metadata such as data type and/or shape. For example, the fingerprint values are invariant under reshapes and bitcasts as long as the batch dimension remain the same:
For string data, one should expect tf.fingerprint(data) != tf.fingerprint(tf.string.reduce_join(data)) in general.


foldl on the list of tensors unpacked from elems on dimension 0. (deprecated argument values)
This foldl operator repeatedly applies the callable fn to a sequence of elements from first to last. The elements are made of the tensors unpacked from elems on dimension 0. The callable fn takes two tensors as arguments. The first argument is the accumulated value computed from the preceding invocation of fn, and the second is the value at the current position of elems. If initializer is None, elems must contain at least one element, and its first element is used as the initializer.
Suppose that elems is unpacked into values, a list of tensors. The shape of the result tensor is fn(initializer, values[0]).shape`.
This method also allows multi-arity elems and output of fn. If elems is a (possibly nested) list or tuple of tensors, then each of these tensors must have a matching first (unpack) dimension. The signature of fn may match the structure of elems. That is, if elems is (t1, [t2, t3, [t4, t5]]), then an appropriate signature for fn is: fn = lambda (t1, [t2, t3, [t4, t5]]):.


foldr on the list of tensors unpacked from elems on dimension 0. (deprecated argument values)
This foldr operator repeatedly applies the callable fn to a sequence of elements from last to first. The elements are made of the tensors unpacked from elems. The callable fn takes two tensors as arguments. The first argument is the accumulated value computed from the preceding invocation of fn, and the second is the value at the current position of elems. If initializer is None, elems must contain at least one element, and its first element is used as the initializer.
Suppose that elems is unpacked into values, a list of tensors. The shape of the result tensor is fn(initializer, values[0]).shape.
This method also allows multi-arity elems and output of fn. If elems is a (possibly nested) list or tuple of tensors, then each of these tensors must have a matching first (unpack) dimension. The signature of fn may match the structure of elems. That is, if elems is (t1, [t2, t3, [t4, t5]]), then an appropriate signature for fn is: fn = lambda (t1, [t2, t3, [t4, t5]]):.


Compiles a function into a callable TensorFlow graph.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.function
tf.function constructs a callable that executes a TensorFlow graph (tf.Graph) created by trace-compiling the TensorFlow operations in func, effectively executing func as a TensorFlow graph.
Features
func may use data-dependent control flow, including if, for, while break, continue and return statements:
func's closure may include tf.Tensor and tf.Variable objects:
func may also use ops with side effects, such as tf.print, tf.Variable and others:
Instead, use TensorFlow collections like tf.TensorArray:
tf.function is polymorphic
Internally, tf.function can build more than one graph, to support arguments with different data types or shapes, since TensorFlow can build more efficient graphs that are specialized on shapes and dtypes. tf.function also treats any pure Python value as opaque objects, and builds a separate graph for each set of Python arguments that it encounters.
To obtain an individual graph, use the get_concrete_function method of the callable created by tf.function. It can be called with the same arguments as func and returns a special tf.Graph object:
Python numerical arguments should only be used when they take few distinct values, such as hyperparameters like the number of layers in a neural network.
Input signatures
For Tensor arguments, tf.function instantiates a separate graph for every unique set of input shapes and datatypes. The example below creates two separate graphs, each specialized to a different shape:
An "input signature" can be optionally provided to tf.function to control the graphs traced. The input signature specifies the shape and type of each Tensor argument to the function using a tf.TensorSpec object. More general shapes can be used. This is useful to avoid creating multiple graphs when Tensors have dynamic shapes. It also restricts the shape and datatype of Tensors that can be used:
Variables may only be created once
tf.function only allows creating new tf.Variable objects when it is called for the first time:
In general, it is recommended to create stateful objects like tf.Variable outside of tf.function and passing them as arguments.
Using type annotations to improve performance
'experimental_follow_type_hints` can be used along with type annotations to improve performance by reducing the number of expensive graph retracings. For example, an argument annotated with tf.Tensor is converted to Tensor even when the input is a non-Tensor value.


Gather slices from params axis axis according to indices.
Gather slices from params axis axis according to indices. indices must be an integer tensor of any dimension (usually 0-D or 1-D).
For 0-D (scalar) indices:
Where N = ndims(params).
For 1-D (vector) indices with batch_dims=0:
In the general case, produces an output tensor where:
Where N = ndims(params), M = ndims(indices), and B = batch_dims. Note that params.shape[:batch_dims] must be identical to indices.shape[:batch_dims].
The shape of the output tensor is:
output.shape = params.shape[:axis] + indices.shape[batch_dims:] + params.shape[axis + 1:].
Note that on CPU, if an out of bound index is found, an error is returned. On GPU, if an out of bound index is found, a 0 is stored in the corresponding output value.
See also tf.gather_nd.


Gather slices from params into a Tensor with shape specified by indices.
indices is an K-dimensional integer tensor, best thought of as a (K-1)-dimensional tensor of indices into params, where each element defines a slice of params:
Whereas in tf.gather indices defines slices into the first dimension of params, in tf.gather_nd, indices defines slices into the first N dimensions of params, where N = indices.shape[-1].
The last dimension of indices can be at most the rank of params:
The last dimension of indices corresponds to elements (if indices.shape[-1] == params.rank) or slices (if indices.shape[-1] < params.rank) along dimension indices.shape[-1] of params. The output tensor has shape
Additionally both 'params' and 'indices' can have M leading batch dimensions that exactly match. In this case 'batch_dims' must be M.
Note that on CPU, if an out of bound index is found, an error is returned. On GPU, if an out of bound index is found, a 0 is stored in the corresponding output value.
Some examples below.
Simple indexing into a matrix:
Slice indexing into a matrix:
Indexing into a 3-tensor:
The examples below are for the case when only indices have leading extra dimensions. If both 'params' and 'indices' have leading batch dimensions, use the 'batch_dims' parameter to run gather_nd in batch mode.
Batched indexing into a matrix:
Batched slice indexing into a matrix:
Batched indexing into a 3-tensor:
Examples with batched 'params' and 'indices':
See also tf.gather.


Return TF logger instance.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.get_logger


Returns the constant value of the given tensor, if efficiently calculable.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.get_static_value
This function attempts to partially evaluate the given tensor, and returns its value as a numpy ndarray if this succeeds.
Compatibility(V1): If constant_value(tensor) returns a non-None result, it will no longer be possible to feed a different value for tensor. This allows the result of this function to influence the graph that is constructed, and permits static shape optimizations.


Constructs symbolic derivatives of sum of ys w.r.t. x in xs.
tf.gradients is only valid in a graph context. In particular, it is valid in the context of a tf.function wrapper, where code is executing as a graph.
ys and xs are each a Tensor or a list of tensors. grad_ys is a list of Tensor, holding the gradients received by the ys. The list must be the same length as ys.
gradients() adds ops to the graph to output the derivatives of ys with respect to xs. It returns a list of Tensor of length len(xs) where each tensor is the sum(dy/dx) for y in ys and for x in xs.
grad_ys is a list of tensors of the same length as ys that holds the initial gradients for each y in ys. When grad_ys is None, we fill in a tensor of '1's of the shape of y for each y in ys. A user can provide their own initial grad_ys to compute the derivatives using a different initial gradient for each y (e.g., if one wanted to weight the gradient differently for each value in each y).
stop_gradients is a Tensor or a list of tensors to be considered constant with respect to all xs. These tensors will not be backpropagated through, as though they had been explicitly disconnected using stop_gradient. Among other things, this allows computation of partial derivatives as opposed to total derivatives. For example:
Here the partial derivatives g evaluate to [1.0, 1.0], compared to the total derivatives tf.gradients(a + b, [a, b]), which take into account the influence of a on b and evaluate to [3.0, 1.0]. Note that the above is equivalent to:
stop_gradients provides a way of stopping gradient after the graph has already been constructed, as compared to tf.stop_gradient which is used during graph construction. When the two approaches are combined, backpropagation stops at both tf.stop_gradient nodes and nodes in stop_gradients, whichever is encountered first.
All integer tensors are considered constant with respect to all xs, as if they were included in stop_gradients.
unconnected_gradients determines the value returned for each x in xs if it is unconnected in the graph to ys. By default this is None to safeguard against errors. Mathematically these gradients are zero which can be requested using the 'zero' option. tf.UnconnectedGradients provides the following options and behaviors:
Let us take one practical example which comes during the back propogation phase. This function is used to evaluate the derivatives of the cost function with respect to Weights Ws and Biases bs. Below sample implementation provides the exaplantion of what it is actually used for :


Record operations for automatic differentiation.
Main aliases
tf.autodiff.GradientTape
See Migration guide for more details.
tf.compat.v1.GradientTape
Operations are recorded if they are executed within this context manager and at least one of their inputs is being "watched".
Trainable variables (created by tf.Variable or tf.compat.v1.get_variable, where trainable=True is default in both cases) are automatically watched. Tensors can be manually watched by invoking the watch method on this context manager.
For example, consider the function y = x * x. The gradient at x = 3.0 can be computed as:
GradientTapes can be nested to compute higher-order derivatives. For example,
By default, the resources held by a GradientTape are released as soon as GradientTape.gradient() method is called. To compute multiple gradients over the same computation, create a persistent gradient tape. This allows multiple calls to the gradient() method as resources are released when the tape object is garbage collected. For example:
By default GradientTape will automatically watch any trainable variables that are accessed inside the context. If you want fine grained control over which variables are watched you can disable automatic tracking by passing watch_accessed_variables=False to the tape constructor:
Note that when using models you should ensure that your variables exist when using watch_accessed_variables=False. Otherwise it's quite easy to make your first iteration not have any gradients:
Note that only tensors with real or complex dtypes are differentiable.
View source
Computes and stacks per-example jacobians.
See wikipedia article for the definition of a Jacobian. This function is essentially an efficient implementation of the following:
tf.stack([self.jacobian(y[i], x[i]) for i in range(x.shape[0])]).
Note that compared to GradientTape.jacobian which computes gradient of each output value w.r.t each input value, this function is useful when target[i,...] is independent of source[j,...] for j != i. This assumption allows more efficient computation as compared to GradientTape.jacobian. The output, as well as intermediate activations, are lower dimensional and avoid a bunch of redundant zeros which would result in the jacobian computation given the independence assumption.
View source
Computes the gradient using operations recorded in context of this tape.
View source
Computes the jacobian using operations recorded in context of this tape.
Seewikipedia article for the definition of a Jacobian.
View source
Clears all information stored in this tape.
Equivalent to exiting and reentering the tape context manager with a new tape. For example, the two following code blocks are equivalent:
This is useful if you don't want to exit the context manager for the tape, or can't because the desired reset point is inside a control flow construct:
View source
Temporarily stops recording operations on this tape.
Operations executed while this context manager is active will not be recorded on the tape. This is useful for reducing the memory used by tracing all computations.
View source
Ensures that tensor is being traced by this tape.
View source
Returns variables watched by this tape in order of construction.
View source
Enters a context inside which operations are recorded on this tape.
View source
Exits the recording context, no further operations are traced.


Creates a grad-pass-through op with the forward behavior provided in f.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.grad_pass_through
Use this function to wrap any op, maintaining its behavior in the forward pass, but replacing the original op in the backward graph with an identity. For example:
Another example is a 'differentiable' moving average approximation, where gradients are allowed to flow into the last value fed to the moving average, but the moving average is still used for the forward pass:


A TensorFlow computation, represented as a dataflow graph.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.Graph
Graphs are used by tf.functions to represent the function's computations. Each graph contains a set of tf.Operation objects, which represent units of computation; and tf.Tensor objects, which represent the units of data that flow between operations.
A tf.Graph can be constructed and used directly without a tf.function, as was required in TensorFlow 1, but this is deprecated and it is recommended to use a tf.function instead. If a graph is directly used, other deprecated TensorFlow 1 classes are also required to execute the graph, such as a tf.compat.v1.Session.
A default graph can be registered with the tf.Graph.as_default context manager. Then, operations will be added to the graph instead of being executed eagerly. For example:
tf.compat.v1.get_default_graph() can be used to obtain the default graph.
Important note: This class is not thread-safe for graph construction. All operations should be created from a single thread, or external synchronization must be provided. Unless otherwise specified, all methods are not thread-safe.
A Graph instance supports an arbitrary number of "collections" that are identified by name. For convenience when building a large graph, collections can store groups of related objects: for example, the tf.Variable uses a collection (named tf.GraphKeys.GLOBAL_VARIABLES) for all variables that are created during the construction of a graph. The caller may define additional collections by specifying a new name.
For details on the meaning of each version, see GraphDef.
Note that this is unrelated to the tf.Graph.graph_def_versions.
View source
Stores value in the collection with the given name.
Note that collections are not sets, so it is possible to add a value to a collection several times.
View source
Stores value in the collections given by names.
Note that collections are not sets, so it is possible to add a value to a collection several times. This function makes sure that duplicates in names are ignored, but it will not check for pre-existing membership of value in any of the collections in names.
names can be any iterable, but if names is a string, it is treated as a single collection name.
View source
Returns a context manager that makes this Graph the default graph.
This method should be used if you want to create multiple graphs in the same process. For convenience, a global default graph is provided, and all ops will be added to this graph if you do not create a new graph explicitly.
Use this method with the with keyword to specify that ops created within the scope of a block should be added to this graph. In this case, once the scope of the with is exited, the previous default graph is set again as default. There is a stack, so it's ok to have multiple nested levels of as_default calls.
The default graph is a property of the current thread. If you create a new thread, and wish to use the default graph in that thread, you must explicitly add a with g.as_default(): in that thread's function.
The following code examples are equivalent:
If eager execution is enabled ops created under this context manager will be added to the graph instead of executed eagerly.
View source
Returns a serialized GraphDef representation of this graph.
The serialized GraphDef can be imported into another Graph (using tf.import_graph_def) or used with the C++ Session API.
This method is thread-safe.
View source
Returns the object referred to by obj, as an Operation or Tensor.
This function validates that obj represents an element of this graph, and gives an informative error message if it is not.
This function is the canonical way to get/validate an object of one of the allowed types from an external argument reference in the Session API.
This method may be called concurrently from multiple threads.
View source
Clears all values in a collection.
View source
Returns a context manager that specifies an op to colocate with.
b and c will always be colocated with a, no matter where a is eventually placed.
If op is None then ignore_existing must be True and the new scope resets all colocation and device constraints.
View source
Returns a context manager that specifies the resource container to use.
Stateful operations, such as variables and queues, can maintain their states on devices so that they can be shared by multiple processes. A resource container is a string name under which these stateful operations are tracked. These resources can be released or cleared with tf.Session.reset().
View source
Returns a context manager that specifies control dependencies.
Use with the with keyword to specify that all operations constructed within the context should have control dependencies on control_inputs. For example:
Multiple calls to control_dependencies() can be nested, and in that case a new Operation will have control dependencies on the union of control_inputs from all active contexts.
You can pass None to clear the control dependencies:
Also note that though execution of ops created under this scope will trigger execution of the dependencies, the ops created under this scope might still be pruned from a normal tensorflow graph. For example, in the following snippet of code the dependencies are never executed:
This is because evaluating the gradient graph does not require evaluating the constant(1) op created in the forward pass.
View source
Creates an Operation in this graph. (deprecated arguments)
This is a low-level interface for creating an Operation. Most programs will not call this method directly, and instead use the Python op constructors, such as tf.constant(), which add ops to the default graph.
View source
Returns a context manager that specifies the default device to use.
The device_name_or_function argument may either be a device name string, a device function, or None:
For information about the valid syntax of device name strings, see the documentation in DeviceNameUtils.
View source
Finalizes this graph, making it read-only.
After calling g.finalize(), no new operations can be added to g. This method is used to ensure that no operations are added to a graph when it is shared between multiple threads, for example when using a tf.compat.v1.train.QueueRunner.
View source
Returns a list of collections used in this graph.
View source
Returns a list of values in the collection with the given name.
This is different from get_collection_ref() which always returns the actual collection list if it exists in that it returns a new list each time it is called.
View source
Returns a list of values in the collection with the given name.
If the collection exists, this returns the list itself, which can be modified in place to change the collection. If the collection does not exist, it is created as an empty list and the list is returned.
This is different from get_collection() which always returns a copy of the collection list if it exists and never creates an empty collection.
View source
Returns the current name scope.
would print the string scope1/scope2.
View source
Returns the Operation with the given name.
This method may be called concurrently from multiple threads.
View source
Return the list of operations in the graph.
You can modify the operations in place, but modifications to the list such as inserts/delete have no effect on the list of operations known to the graph.
This method may be called concurrently from multiple threads.
View source
Returns the Tensor with the given name.
This method may be called concurrently from multiple threads.
View source
EXPERIMENTAL: A context manager for overriding gradient functions.
This context manager can be used to override the gradient function that will be used for ops within the scope of the context.
View source
Returns True if and only if tensor is feedable.
View source
Returns True if and only if tensor_or_op is fetchable.
View source
Returns a context manager that creates hierarchical names for operations.
A graph maintains a stack of name scopes. A with name_scope(...): statement pushes a new name onto the stack for the lifetime of the context.
The name argument will be interpreted as follows:
The name of the scope itself can be captured by with g.name_scope(...) as scope:, which stores the name of the scope in the variable scope. This value can be used to name an operation that represents the overall result of executing the ops in a scope. For example:
View source
Marks the given tensor as unfeedable in this graph.
View source
Marks the given op as unfetchable in this graph.
View source
Make device, colocation and dependencies stacks thread-local.
Device, colocation and dependencies stacks are not thread-local be default. If multiple threads access them, then the state is shared. This means that one thread may affect the behavior of another thread.
After this method is called, the stacks become thread-local. If multiple threads access them, then the state is not shared. Each thread uses its own value; a thread doesn't affect other threads by mutating such a stack.
The initial value for every thread's stack is set to the current value of the stack when switch_to_thread_local() was first called.
View source
Return a unique operation name for name.
unique_name is used to generate structured names, separated by "/", to help identify operations when debugging a graph. Operation names are displayed in error messages reported by the TensorFlow runtime, and in various visualization tools such as TensorBoard.
If mark_as_used is set to True, which is the default, a new unique name is created and marked as in use. If it's set to False, the unique name is returned without actually being marked as used. This is useful when the caller simply wants to know what the name to be created will be.


Helpers to manipulate a tensor graph in python.
import_graph_def(...): Imports the graph from graph_def into the current default Graph. (deprecated arguments)


Imports the graph from graph_def into the current default Graph. (deprecated arguments)
Main aliases
tf.import_graph_def
See Migration guide for more details.
tf.compat.v1.graph_util.import_graph_def, tf.compat.v1.import_graph_def
This function provides a way to import a serialized TensorFlow GraphDef protocol buffer, and extract individual objects in the GraphDef as tf.Tensor and tf.Operation objects. Once extracted, these objects are placed into the current default Graph. See tf.Graph.as_graph_def for a way to create a GraphDef proto.


Create an op that groups multiple operations.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.group
When this op finishes, all ops in inputs have finished. This op has no output.
When operating in a v1-style graph context, ops are not executed in the same order as specified in the code; TensorFlow will attempt to execute ops in parallel or in an order convienient to the result it is computing. tf.group allows you to request that one or more results finish before execution continues.
tf.group creates a single op (of type NoOp), and then adds appropriate control dependencies. Thus, c = tf.group(a, b) will compute the same graph as this:
See also tf.tuple and tf.control_dependencies.


Gives a guarantee to the TF runtime that the input tensor is a constant.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.guarantee_const
The runtime is then free to make optimizations based on this.
Only accepts value typed tensors as inputs and rejects resource variable handles as input.
Returns the input tensor without modification.


Constructs the Hessian of sum of ys with respect to x in xs.
hessians() adds ops to the graph to output the Hessian matrix of ys with respect to xs. It returns a list of Tensor of length len(xs) where each tensor is the Hessian of sum(ys).
The Hessian is a matrix of second-order partial derivatives of a scalar tensor (see https://en.wikipedia.org/wiki/Hessian_matrix for more details).


Return histogram of values.
Compat aliases for migration
See Migration guide for more details.
tf.compat.v1.histogram_fixed_width
Given the tensor values, this operation returns a rank 1 histogram counting the number of entries in values that fell into every bin. The bins are equal width and determined by the arguments value_range and nbins.