Home / Class/ identity Class — pytorch Architecture

identity Class — pytorch Architecture

Architecture documentation for the identity class in ReduceOps.cpp from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/ReduceOps.cpp lines 1629–1644

template <int identity, typename Stub>
static inline void allany_impl(
    const Tensor& self,
    const Tensor& result,
    OptionalIntArrayRef dims,
    bool keepdim,
    Stub& stub) {
  if (self.numel() == 0) {
    result.fill_(identity);
  } else if (self.numel() == 1) {
    result.copy_(self.view_as(result).to(at::kBool));
  } else {
    auto iter = get_allany_iter(self, result, dims, keepdim);
    stub(iter.device_type(), iter);
  }
}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free