blob: b7d512d3a9529c08555f493b8923bbc19d1284e0 [file] [log] [blame]
func.func @dynamic_tensor() {
%input = flow.tensor.constant dense<[[-1.0, 2.0, -3.0], [4.0, -5.0, 6.0]]> : tensor<2x3xf32> -> tensor<?x?xf32>
%res = "mhlo.abs"(%input) : (tensor<?x?xf32>) -> tensor<?x?xf32>
%dshape = util.do_not_optimize(%res) : tensor<?x?xf32>
%result = tensor.cast %dshape : tensor<?x?xf32> to tensor<2x3xf32>
check.expect_almost_eq_const(%result, dense<[[1.0, 2.0, 3.0],[4.0, 5.0, 6.0]]> : tensor<2x3xf32>) : tensor<2x3xf32>
return
}