From c822d62ba27b874a130e9d8d434c12b419d10d62 Mon Sep 17 00:00:00 2001 From: Louis Verhaard Date: Thu, 11 Mar 2021 14:59:06 +0100 Subject: MLBEDSW-4223: Full support for PAD operator - Added full support for PAD operator - Hardware padding is still used whenever possible - Bug fix Pad followed by max pool if IFM contains negative values Change-Id: Ifc64d1943737d94466f5e2821009dab12a49a965 Signed-off-by: Louis Verhaard --- ethosu/vela/operation.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ethosu/vela/operation.py') diff --git a/ethosu/vela/operation.py b/ethosu/vela/operation.py index d2b08b58..a5a58e8a 100644 --- a/ethosu/vela/operation.py +++ b/ethosu/vela/operation.py @@ -424,6 +424,8 @@ class Operation: "read_offsets", "rounding_mode", "low_precision_scaling", + "write_offset", + "write_shape", ) def __init__(self, op_type: Op, name: str): @@ -438,7 +440,7 @@ class Operation: # Fused activation function. If not none: operator code. self.activation: Optional[ActivationFunction] = None # Fused memory function, if not None: operator code - self.memory_function = None + self.memory_function: Optional[Op] = None # If not none: contains QuantizationParameters to be used as output quantization # (which overrides the ofm tensor's quantization), used in LUT self.forced_input_quantization = None @@ -457,6 +459,12 @@ class Operation: # The Mean operator (implemented as a depthwise convolution) requires scaling # to be calculated differently in one case. In that case, this is set to True. self.low_precision_scaling = False + # Write offset, for operations that only produce a part of the OFM + self.write_offset: Optional[Shape4D] = None + # The amount of OFM that is produced by the operation (only if write_offset is not None). + # E.g. an operation that only fills the bottom row of an OFM of size 1x10x8x1 would have + # write_offset 0,9,0,0, write_shape 1,1,8,1 + self.write_shape: Optional[Shape4D] = None def clone(self, suffix="_clone"): res = Operation(self.type, self.name + suffix) -- cgit v1.2.1