aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/register_command_stream_generator.py
diff options
context:
space:
mode:
Diffstat (limited to 'ethosu/vela/register_command_stream_generator.py')
-rw-r--r--ethosu/vela/register_command_stream_generator.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/ethosu/vela/register_command_stream_generator.py b/ethosu/vela/register_command_stream_generator.py
index 14898607..c0402b32 100644
--- a/ethosu/vela/register_command_stream_generator.py
+++ b/ethosu/vela/register_command_stream_generator.py
@@ -46,6 +46,7 @@ from .numeric_util import quantise_float32
from .numeric_util import round_away_zero
from .numeric_util import round_up
from .numeric_util import round_up_to_int
+from .numeric_util import full_shape
from .operation import NpuBlockType
from .shared_buffer_allocation import SharedBufferAllocation
from .tensor import MemArea
@@ -266,10 +267,6 @@ def get_op_kernel(ps):
return Kernel(k_w, k_h, strides[2], strides[1], dilation[2], dilation[1])
-def full_shape(shape, fill):
- return ([fill] * (4 - len(shape))) + shape
-
-
def has_prev_op_dependency(prev_cmd, cmd):
if prev_cmd is None:
return False
@@ -282,14 +279,14 @@ def has_prev_op_dependency(prev_cmd, cmd):
def get_op_ofm_rect(cmd):
- start = full_shape(cmd.ofm_box.start_coord, 0)
- end = full_shape(cmd.ofm_box.end_coord, 1)
+ start = full_shape(4, cmd.ofm_box.start_coord, 0)
+ end = full_shape(4, cmd.ofm_box.end_coord, 1)
return Rect(start[-2], start[-3], start[-1], end[-2] - 1, end[-3] - 1, end[-1] - 1)
def get_op_ifm_rect(cmd):
- start = full_shape(cmd.ifm_box.start_coord, 0)
- end = full_shape(cmd.ifm_box.end_coord, 1)
+ start = full_shape(4, cmd.ifm_box.start_coord, 0)
+ end = full_shape(4, cmd.ifm_box.end_coord, 1)
return Rect(start[-2], start[-3], start[-1], end[-2] - 1, end[-3] - 1, end[-1] - 1)