Check that output matches input dimensions