mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-08-20 13:33:25 -07:00
add xlib.avecl
This commit is contained in:
parent
932edfe875
commit
0058474da7
56 changed files with 5569 additions and 0 deletions
37
xlib/avecl/_internal/info/StackInfo.py
Normal file
37
xlib/avecl/_internal/info/StackInfo.py
Normal file
|
@ -0,0 +1,37 @@
|
|||
from ..AShape import AShape
|
||||
|
||||
class StackInfo:
|
||||
__slots__ = ['o_shape', 'axis']
|
||||
|
||||
def __init__(self, shape, axis, stack_count):
|
||||
"""
|
||||
Stack info
|
||||
|
||||
arguments
|
||||
|
||||
shape AShape
|
||||
|
||||
axis Int
|
||||
|
||||
stack_count Int
|
||||
|
||||
errors during the construction:
|
||||
|
||||
ValueError
|
||||
|
||||
result:
|
||||
|
||||
.o_shape AShape
|
||||
|
||||
.axis Int positive axis argument
|
||||
"""
|
||||
if axis < 0:
|
||||
axis = shape.ndim + 1 + axis
|
||||
if axis < 0 or axis > shape.ndim:
|
||||
raise ValueError(f'Wrong axis {axis}')
|
||||
|
||||
if stack_count <= 0:
|
||||
raise ValueError(f'Invalid stack_count {stack_count}')
|
||||
|
||||
self.o_shape = AShape( tuple(shape)[0:axis] + (stack_count,) + tuple(shape)[axis:] )
|
||||
self.axis = axis
|
Loading…
Add table
Add a link
Reference in a new issue