@@ -7,20 +7,19 @@ namespace infini::ops {
77template <Device::Type kDev >
88Operator<Add, kDev , 1 >::Operator(const Tensor input, const Tensor other,
99 Tensor out)
10- : Add{input, other, out},
11- device_index_{out.device ().index ()} {}
10+ : Add{input, other, out}, device_index_{out.device ().index ()} {}
1211
1312template <Device::Type kDev >
1413void Operator<Add, kDev , 1 >::operator ()(const Tensor input, const Tensor other,
1514 Tensor out) const {
16- auto at_input = ToAtenTensor< kDev >(
17- const_cast <void *>(input.data ()), input_shape_, input_strides_ ,
18- input_type_, device_index_);
19- auto at_other = ToAtenTensor< kDev >(
20- const_cast <void *>(other.data ()), other_shape_, other_strides_ ,
21- other_type_, device_index_);
22- auto at_out = ToAtenTensor<kDev >(
23- out. data (), out_shape_, out_strides_, out_type_, device_index_);
15+ auto at_input =
16+ ToAtenTensor< kDev >( const_cast <void *>(input.data ()), input_shape_,
17+ input_strides_, input_type_, device_index_);
18+ auto at_other =
19+ ToAtenTensor< kDev >( const_cast <void *>(other.data ()), other_shape_,
20+ other_strides_, other_type_, device_index_);
21+ auto at_out = ToAtenTensor<kDev >(out. data (), out_shape_, out_strides_,
22+ out_type_, device_index_);
2423
2524 at::add_out (at_out, at_input, at_other);
2625}
0 commit comments