diff options
author | Tim Hall <tim.hall@arm.com> | 2021-02-04 22:47:46 +0000 |
---|---|---|
committer | Tim Hall <tim.hall@arm.com> | 2021-02-05 11:30:49 +0000 |
commit | 73e843f76dd71e4ab5e07a7616c2c4806ca6ac25 (patch) | |
tree | 73c35c5443e041441ba826cacfc12f21d5b30bac /ethosu/vela/softmax.py | |
parent | 133ba7e39c9517d43690c55197d71733ad0dc38c (diff) | |
download | ethos-u-vela-73e843f76dd71e4ab5e07a7616c2c4806ca6ac25.tar.gz |
vela: Change Shape4D mutability usage
- Removed requirement for cloning shapes when unique values required
by forcing top-level immutability. This alleviates issues with Shapes
being unintentionally shared and then mutated as if value-types.
- Shape4D fields can no longer be assigned without replication.
Signed-off-by: Tim Hall <tim.hall@arm.com>
Change-Id: Ic0dbfa349eb0215eabefb4f4e2cf99f12d83699c
Diffstat (limited to 'ethosu/vela/softmax.py')
-rw-r--r-- | ethosu/vela/softmax.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ethosu/vela/softmax.py b/ethosu/vela/softmax.py index c3b0611a..4418f011 100644 --- a/ethosu/vela/softmax.py +++ b/ethosu/vela/softmax.py @@ -216,10 +216,9 @@ class SoftMax: # Reshape ifm/ofm (if needed) ifm_shape = self.op.ifm_shapes[0] if ifm_shape.batch > 1: - ifm_shape.height = ifm_shape.batch * ifm_shape.height - ifm_shape.batch = 1 + self.op.ifm_shapes[0] = ifm_shape.with_height(ifm_shape.batch * ifm_shape.height).with_batch(1) self.op.ifm.avoid_NHCWB16 = True - self.op.ofm_shapes[0] = ifm_shape.clone() + self.op.ofm_shapes[0] = self.op.ifm_shapes[0] self.op.ofm.avoid_NHCWB16 = True if ifm.dtype in (DataType.uint8, DataType.int8) and ofm.dtype == ifm.dtype: |