mirror of
https://github.com/iperov/DeepFaceLive
synced 2025-08-21 14:03:20 -07:00
update xlib.avecl
This commit is contained in:
parent
2d401f47f8
commit
6da916cc66
14 changed files with 246 additions and 184 deletions
|
@ -1,6 +1,9 @@
|
|||
from typing import List
|
||||
|
||||
import numpy as np
|
||||
|
||||
from ..AShape import AShape
|
||||
from ..AAxes import AAxes
|
||||
from ..backend import Kernel
|
||||
from ..HKernel import HKernel
|
||||
from ..HType import HType
|
||||
|
@ -9,6 +12,29 @@ from ..SCacheton import SCacheton
|
|||
from ..Tensor import Tensor
|
||||
|
||||
|
||||
def split(input_t : Tensor, axis, keepdims=False) -> List[Tensor]:
|
||||
"""
|
||||
|
||||
arguments
|
||||
|
||||
input_t Tensor
|
||||
|
||||
axis
|
||||
|
||||
"""
|
||||
shape = input_t.shape
|
||||
|
||||
result = []
|
||||
for i in range(shape[axis]):
|
||||
slices = [slice(None, None, None)]*shape.ndim
|
||||
|
||||
slices[axis] = i if not keepdims else slice(i,i+1,1)
|
||||
|
||||
result.append( slice_(input_t, slices) )
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def slice_(input_t : Tensor, slices, dtype : np.dtype = None, output_t=None, is_add_to_output=False) -> Tensor:
|
||||
"""
|
||||
arguments:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue