@@ -25,13 +25,6 @@ func @testAddHighDimsHaveSameShape(%arg0: tensor<1x2x3x4x5x6x7x8xi32>, %arg1: te
2525 return %0 : tensor <1 x2 x3 x4 x5 x6 x7 x8 xi32 >
2626}
2727
28- // CHECK-LABEL: testAddTooHighBroadcastableDims
29- func @testAddTooHighBroadcastableDims (%arg0: tensor <1 x2 x3 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
30- // expected-error @+1 {{'tfl.add' op failed to verify that operand #0 and operand #1 have the same shape or broadcastable shapes within the rank 4}}
31- %0 = " tf.Add" (%arg0 , %arg1 ) : (tensor <1 x2 x3 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
32- return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
33- }
34-
3528func @LeakyRelu (%arg0: tensor <1 xf32 >) -> tensor <1 xf32 > {
3629 %2 = " tf.LeakyRelu" (%arg0 ) {alpha = 0.1 : f32 } : (tensor <1 xf32 >) -> tensor <1 xf32 >
3730 return %2: tensor <1 xf32 >
@@ -1530,7 +1523,11 @@ func @select_v2_with_6d_broadcasting(%arg0: tensor<1x1x1x1x3x1xi1>, %arg1 : tens
15301523 %0 = " tf.SelectV2" (%arg0 , %arg1 , %arg2 ): (tensor <1 x1 x1 x1 x3 x1 xi1 >, tensor <1 x1 x1 x1 x1 x4 xf32 >, tensor <1 x1 x1 x2 x1 x1 xf32 >) -> tensor <1 x1 x1 x2 x3 x4 xf32 >
15311524 return %0 : tensor <1 x1 x1 x2 x3 x4 xf32 >
15321525// CHECK-LABEL: select_v2_with_6d_broadcasting
1533- // CHECK: "tf.SelectV2"(%arg0, %arg1, %arg2)
1526+ // CHECK: [[CST:%.*]] = constant dense<[1, 1, 1, 2, 3, 4]> : tensor<6xi64>
1527+ // CHECK: [[BCT:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1528+ // CHECK: [[BCT_0:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1529+ // CHECK: [[BCT_1:%.*]] = "tfl.broadcast_to"(%arg2, [[CST]])
1530+ // CHECK: "tfl.select"([[BCT]], [[BCT_0]], [[BCT_1]])
15341531}
15351532
15361533// -----
@@ -1540,7 +1537,9 @@ func @maximum_with_6d_broadcasting(%arg0: tensor<1x1x1x1x8x16xf32>, %arg1: tenso
15401537 return %0 : tensor <1 x1 x1 x1 x8 x16 xf32 >
15411538
15421539// CHECK-LABEL: maximum_with_6d_broadcasting
1543- // CHECK: "tf.Maximum"(%arg0, %arg1)
1540+ // CHECK: [[CST:%.*]] = constant dense<[1, 1, 1, 1, 8, 16]> : tensor<6xi64>
1541+ // CHECK: [[BCT:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1542+ // CHECK: "tfl.maximum"(%arg0, [[BCT]])
15441543}
15451544
15461545// -----
@@ -1549,5 +1548,169 @@ func @add_with_int32_5d_inputs(%arg0: tensor<1x1x1x3x1xi32>, %arg1 : tensor<1x1x
15491548 %0 = " tf.Add" (%arg0 , %arg1 ): (tensor <1 x1 x1 x3 x1 xi32 >, tensor <1 x1 x1 x1 x4 xi32 >) -> tensor <1 x1 x1 x3 x4 xi32 >
15501549 return %0 : tensor <1 x1 x1 x3 x4 xi32 >
15511550// CHECK-LABEL: add_with_int32_5d_inputs
1552- // CHECK: "tf.Add"(%arg0, %arg1)
1551+ // CHECK: [[CST:%.*]] = constant dense<[1, 1, 1, 3, 4]> : tensor<5xi64>
1552+ // CHECK: [[BCT:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1553+ // CHECK: [[BCT_0:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1554+ // CHECK: tfl.add [[BCT]], [[BCT_0]]
1555+ }
1556+
1557+ // CHECK-LABEL: testAddWithBroadcastToOps
1558+ func @testAddWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
1559+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1560+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1561+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1562+ // CHECK: tfl.add [[BCAST]], [[BCAST_1]] {fused_activation_function = "NONE"} : tensor<1x2x3x4x5x6xi32>
1563+ %0 = " tf.Add" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
1564+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
1565+ }
1566+
1567+ // CHECK-LABEL: testSubWithBroadcastToOps
1568+ func @testSubWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
1569+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1570+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1571+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1572+ // CHECK: tfl.sub [[BCAST]], [[BCAST_1]] {fused_activation_function = "NONE"} : tensor<1x2x3x4x5x6xi32>
1573+ %0 = " tf.Sub" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
1574+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
1575+ }
1576+
1577+ // CHECK-LABEL: testMulWithBroadcastToOps
1578+ func @testMulWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
1579+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1580+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1581+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1582+ // CHECK: tfl.mul [[BCAST]], [[BCAST_1]] {fused_activation_function = "NONE"} : tensor<1x2x3x4x5x6xi32>
1583+ %0 = " tf.Mul" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
1584+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
1585+ }
1586+
1587+ // CHECK-LABEL: testDivWithBroadcastToOps
1588+ func @testDivWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
1589+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1590+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1591+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1592+ // CHECK: tfl.div [[BCAST]], [[BCAST_1]] {fused_activation_function = "NONE"} : tensor<1x2x3x4x5x6xi32>
1593+ %0 = " tf.Div" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
1594+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
1595+ }
1596+
1597+ // CHECK-LABEL: testFloorDivWithBroadcastToOps
1598+ func @testFloorDivWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
1599+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1600+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1601+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1602+ // CHECK: tfl.floor_div [[BCAST]], [[BCAST_1]] : tensor<1x2x3x4x5x6xi32>
1603+ %0 = " tf.FloorDiv" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
1604+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
1605+ }
1606+
1607+ // CHECK-LABEL: testFloorModWithBroadcastToOps
1608+ func @testFloorModWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
1609+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1610+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1611+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1612+ // CHECK: "tfl.floor_mod"([[BCAST]], [[BCAST_1]]) : (tensor<1x2x3x4x5x6xi32>, tensor<1x2x3x4x5x6xi32>) -> tensor<1x2x3x4x5x6xi32>
1613+ %0 = " tf.FloorMod" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
1614+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
1615+ }
1616+
1617+ // CHECK-LABEL: testPowWithBroadcastToOps
1618+ func @testPowWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
1619+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1620+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1621+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1622+ // CHECK: tfl.pow [[BCAST]], [[BCAST_1]] : tensor<1x2x3x4x5x6xi32>
1623+ %0 = " tf.Pow" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
1624+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
1625+ }
1626+
1627+ // CHECK-LABEL: testMaximumWithBroadcastToOps
1628+ func @testMaximumWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
1629+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1630+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1631+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1632+ // CHECK: "tfl.maximum"([[BCAST]], [[BCAST_1]]) : (tensor<1x2x3x4x5x6xi32>, tensor<1x2x3x4x5x6xi32>) -> tensor<1x2x3x4x5x6xi32>
1633+ %0 = " tf.Maximum" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
1634+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
1635+ }
1636+
1637+ // CHECK-LABEL: testMinimumWithBroadcastToOps
1638+ func @testMinimumWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
1639+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1640+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1641+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1642+ // CHECK: "tfl.minimum"([[BCAST]], [[BCAST_1]]) : (tensor<1x2x3x4x5x6xi32>, tensor<1x2x3x4x5x6xi32>) -> tensor<1x2x3x4x5x6xi32>
1643+ %0 = " tf.Minimum" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
1644+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
1645+ }
1646+
1647+ // CHECK-LABEL: testSelectV2WithBroadcastToOps
1648+ func @testSelectV2WithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x1 x6 xi1 >, %arg1: tensor <1 x2 x3 x4 x1 x1 xi32 >, %arg2: tensor <1 x2 x1 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 > {
1649+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1650+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1651+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1652+ // CHECK: [[BCAST_2:%.*]] = "tfl.broadcast_to"(%arg2, [[CST]])
1653+ // CHECK: "tfl.select"([[BCAST]], [[BCAST_1]], [[BCAST_2]])
1654+ %0 = " tf.SelectV2" (%arg0 , %arg1 , %arg2 ) : (tensor <1 x2 x1 x4 x1 x6 xi1 >, tensor <1 x2 x3 x4 x1 x1 xi32 >, tensor <1 x2 x1 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi32 >
1655+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi32 >
1656+ }
1657+
1658+ // CHECK-LABEL: testLessEqualWithBroadcastToOps
1659+ func @testLessEqualWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 > {
1660+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1661+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1662+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1663+ // CHECK: "tfl.less_equal"([[BCAST]], [[BCAST_1]]) : (tensor<1x2x3x4x5x6xi32>, tensor<1x2x3x4x5x6xi32>) -> tensor<1x2x3x4x5x6xi1>
1664+ %0 = " tf.LessEqual" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 >
1665+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi1 >
1666+ }
1667+
1668+ // CHECK-LABEL: testGreaterEqualWithBroadcastToOps
1669+ func @testGreaterEqualWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 > {
1670+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1671+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1672+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1673+ // CHECK: "tfl.greater_equal"([[BCAST]], [[BCAST_1]]) : (tensor<1x2x3x4x5x6xi32>, tensor<1x2x3x4x5x6xi32>) -> tensor<1x2x3x4x5x6xi1>
1674+ %0 = " tf.GreaterEqual" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 >
1675+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi1 >
1676+ }
1677+
1678+ // CHECK-LABEL: testEqualWithBroadcastToOps
1679+ func @testEqualWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 > {
1680+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1681+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1682+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1683+ // CHECK: "tfl.equal"([[BCAST]], [[BCAST_1]]) : (tensor<1x2x3x4x5x6xi32>, tensor<1x2x3x4x5x6xi32>) -> tensor<1x2x3x4x5x6xi1>
1684+ %0 = " tf.Equal" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 >
1685+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi1 >
1686+ }
1687+
1688+ // CHECK-LABEL: testNotEqualWithBroadcastToOps
1689+ func @testNotEqualWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 > {
1690+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1691+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1692+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1693+ // CHECK: "tfl.not_equal"([[BCAST]], [[BCAST_1]]) : (tensor<1x2x3x4x5x6xi32>, tensor<1x2x3x4x5x6xi32>) -> tensor<1x2x3x4x5x6xi1>
1694+ %0 = " tf.NotEqual" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 >
1695+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi1 >
1696+ }
1697+
1698+ // CHECK-LABEL: testLessWithBroadcastToOps
1699+ func @testLessWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 > {
1700+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1701+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1702+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1703+ // CHECK: "tfl.less"([[BCAST]], [[BCAST_1]]) : (tensor<1x2x3x4x5x6xi32>, tensor<1x2x3x4x5x6xi32>) -> tensor<1x2x3x4x5x6xi1>
1704+ %0 = " tf.Less" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 >
1705+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi1 >
1706+ }
1707+
1708+ // CHECK-LABEL: testGreaterWithBroadcastToOps
1709+ func @testGreaterWithBroadcastToOps (%arg0: tensor <1 x2 x1 x4 x5 x6 xi32 >, %arg1: tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 > {
1710+ // CHECK: [[CST:%.*]] = constant dense<[1, 2, 3, 4, 5, 6]> : tensor<6xi64>
1711+ // CHECK: [[BCAST:%.*]] = "tfl.broadcast_to"(%arg0, [[CST]])
1712+ // CHECK: [[BCAST_1:%.*]] = "tfl.broadcast_to"(%arg1, [[CST]])
1713+ // CHECK: "tfl.greater"([[BCAST]], [[BCAST_1]]) : (tensor<1x2x3x4x5x6xi32>, tensor<1x2x3x4x5x6xi32>) -> tensor<1x2x3x4x5x6xi1>
1714+ %0 = " tf.Greater" (%arg0 , %arg1 ) : (tensor <1 x2 x1 x4 x5 x6 xi32 >, tensor <1 x2 x3 x4 x5 x1 xi32 >) -> tensor <1 x2 x3 x4 x5 x6 xi1 >
1715+ return %0 : tensor <1 x2 x3 x4 x5 x6 xi1 >
15531716}
0 commit comments