Class that implements functionality of the Collection container.
More...
- Parameters
-
T | Type of an object stored in the container |
Represents a collection of backward stages of neural network layers
def __init__ |
( |
|
self, |
|
|
|
args |
|
) |
| |
- Variant 1
Default constructor. Sets the size and capacity to 0.
- Variant 2
Constructor. Creates a collection with n empty elements
- Parameters
-
- Variant 3
Constructor. Creates a collection from the array
- Parameters
-
n | Number of elements |
array | Array with elements |
- Variant 4
Copy constructor
- Parameters
-
def __getitem__ |
( |
|
self, |
|
|
|
i |
|
) |
| |
def __lshift__ |
( |
|
self, |
|
|
|
x |
|
) |
| |
Adds an element to the end of a collection
- Parameters
-
def __setitem__ |
( |
|
self, |
|
|
|
i, |
|
|
|
v |
|
) |
| |
Size of an allocated storage
- Returns
- Size of the allocated storage
Clears a collection: removes an array, sets the size and capacity to 0
- Variant 1
Returns pointer to the underlying array serving as element storage
- Returns
- Pointer to the array
- Variant 2
Returns const pointer to the underlying array serving as element storage
- Returns
- Const pointer to the array
Erase an element from a position
- Parameters
-
- Variant 1
Element access
- Parameters
-
index | Index of an accessed element |
- Returns
- Reference to the element
- Variant 2
Const element access
- Parameters
-
index | Index of an accessed element |
- Returns
- Reference to the element
def insert |
( |
|
self, |
|
|
|
args |
|
) |
| |
- Variant 1
Insert an element into a position
- Parameters
-
pos | Position to set |
x | Element to set |
- Variant 2
Insert a collection to another collection into a position
- Parameters
-
pos | Position to see |
other | Collection to set |
def push_back |
( |
|
self, |
|
|
|
x |
|
) |
| |
Adds an element to the end of a collection
- Parameters
-
def resize |
( |
|
self, |
|
|
|
newCapacity |
|
) |
| |
Changes the size of a storage
- Parameters
-
newCapacity | Size of a new storage. |
def safe_push_back |
( |
|
self, |
|
|
|
x |
|
) |
| |
Adds an element to the end of a collection
- Parameters
-
- Returns
- True if the element was successfully added
Size of a collection
- Returns
- Size of the collection
The documentation for this class was generated from the following file:
- algorithms/neural_networks/__init__.py