The tensor.pack ops have pad semantic, so we can fold pad + pack into
pack when
- They have the same padding values or the pack op does not have padding values.
- The pad op does not have low paddings.
The tensor.unpack ops have extract_slice semantic, so we can fold unpack
+ extract_slice into unpack when
- All the offsets are 0s.
- All the strides are 1s.