Home / Class/ dnnl_memory_from_host_scalar Class — pytorch Architecture

dnnl_memory_from_host_scalar Class — pytorch Architecture

Architecture documentation for the dnnl_memory_from_host_scalar class in Utils.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/mkldnn/xpu/detail/Utils.h lines 114–126

template <typename T>
dnnl::memory dnnl_memory_from_host_scalar(
    T host_value,
    Tensor& holder,
    dnnl::engine& engine) {
  auto options = at::TensorOptions()
                     .dtype(c10::CppTypeToScalarType<T>::value)
                     .device(kXPU);
  holder = at::empty({1}, options).fill_(host_value);
  dnnl::memory::desc md = get_onednn_md(holder);
  dnnl::memory mem = make_onednn_memory(md, engine, holder.data_ptr());
  return mem;
}

Analyze Your Own Codebase

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

Try Supermodel Free