Home / Class/ GetMutable Class — pytorch Architecture

GetMutable Class — pytorch Architecture

Architecture documentation for the GetMutable class in blob.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/core/blob.h lines 95–108

  template <class T>
  T* GetMutable() {
    static_assert(
        std::is_default_constructible_v<T>,
        "GetMutable can't be called with non-default-constructible types. "
        "Try using specialized methods");
    if (IsType<T>()) {
      return static_cast<T*>(pointer_);
    } else {
      // TODO Re-enable logging
      // VLOG(1) << "Create new mutable object " << TypeMeta::TypeName<T>();
      return Reset<T>(new T());
    }
  }

Analyze Your Own Codebase

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

Try Supermodel Free