in basic_pitch/layers/signal.py [0:0]
def build(self, input_shape: tf.Tensor) -> None:
self.squeeze_batch = lambda batch: batch
rank = input_shape.rank
if rank == 4:
assert input_shape[1] == 1, "If the rank is 4, the second dimension must be length 1"
self.squeeze_batch = lambda batch: tf.squeeze(batch, axis=1)
else:
assert rank == 3, f"Only ranks 3 and 4 are supported!. Received rank {rank} for {input_shape}."