unary_op_impl_with_complex_to_float Class — pytorch Architecture
Architecture documentation for the unary_op_impl_with_complex_to_float class in UnaryOps.cpp from the pytorch codebase.
Entity Profile
Source Code
aten/src/ATen/native/UnaryOps.cpp lines 470–480
template <typename OutImpl>
static inline Tensor unary_op_impl_with_complex_to_float(const Tensor& self, OutImpl& out_impl) {
if (self.is_complex()) {
const auto float_type = c10::toRealValueType(self.scalar_type());
Tensor result = at::empty_like(self, self.options().dtype(float_type));
return out_impl(result, self);
}
Tensor result = at::empty({0}, self.options());
return out_impl(result, self);
}
Source
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free