Closed makslevental closed 1 year ago
This PR implements casting python vals to corresponding ArithValues;
ArithValue
one = Scalar(1.0, dtype=f64, fold=False) # CHECK: %[[VAL_0:.*]] = arith.constant 1.000000e+00 : f64 print(one.owner) start = one * 100.0 ten = Tensor(np.array([[1.0, 2.0], [3.0, 4.0]]), dtype=f64, fold=False) # CHECK: %[[VAL_13:.*]] = arith.constant dense<{{\[\[}}1.000000e+00, 2.000000e+00], [3.000000e+00, 4.000000e+00]]> : tensor<2x2xf64> print(ten.owner) two_times_ten = ten * 2.0 # CHECK: %[[VAL_16:.*]] = arith.constant dense<1.000000e+00> : tensor<2x2xf64> print(two_times_ten.owner.operands[1].owner) # CHECK: %[[VAL_17:.*]] = arith.mulf %[[VAL_13]], %[[VAL_16]] : tensor<2x2xf64> print(two_times_ten.owner)
This PR implements casting python vals to corresponding
ArithValue
s;