InfiniOps
Operator Library for Accelerators
Loading...
Searching...
No Matches
infini::ops::NativeBatchNorm Class Referenceabstract

#include <native_batch_norm.h>

Inheritance diagram for infini::ops::NativeBatchNorm:
infini::ops::Operator< NativeBatchNorm > infini::ops::OperatorBase infini::ops::OperatorBase

Public Member Functions

 NativeBatchNorm (const Tensor input, const std::optional< Tensor > weight, const std::optional< Tensor > bias, const std::optional< Tensor > running_mean, const std::optional< Tensor > running_var, const bool training, const double momentum, const double eps, Tensor out, Tensor save_mean, Tensor save_invstd)
 
virtual void operator() (const Tensor input, const std::optional< Tensor > weight, const std::optional< Tensor > bias, const std::optional< Tensor > running_mean, const std::optional< Tensor > running_var, const bool training, const double momentum, const double eps, Tensor out, Tensor save_mean, Tensor save_invstd) const =0
 
- Public Member Functions inherited from infini::ops::Operator< NativeBatchNorm >
void operator() (const Handle &handle, const Args &... args)
 
void operator() (const Args &... args) const
 
void operator() (const Handle &handle, const Args &... args)
 
void operator() (const Args &... args) const
 
- Public Member Functions inherited from infini::ops::OperatorBase
virtual ~OperatorBase ()=default
 
virtual std::size_t workspace_size_in_bytes () const
 
void set_handle (const Handle &handle)
 
void set_config (const Config &config)
 
void set_stream (void *stream)
 
void set_workspace (void *workspace)
 
void set_workspace_size_in_bytes (std::size_t workspace_size_in_bytes)
 
virtual ~OperatorBase ()=default
 
virtual std::size_t workspace_size_in_bytes () const
 
void set_handle (const Handle &handle)
 
void set_config (const Config &config)
 
void set_stream (void *stream)
 
void set_workspace (void *workspace)
 
void set_workspace_size_in_bytes (std::size_t workspace_size_in_bytes)
 

Protected Attributes

Tensor::Shape input_shape_
 
Tensor::Strides input_strides_
 
DataType input_type_
 
Tensor::Shape out_shape_
 
Tensor::Strides out_strides_
 
DataType out_type_
 
Tensor::Shape save_mean_shape_
 
Tensor::Strides save_mean_strides_
 
DataType save_mean_type_
 
Tensor::Shape save_invstd_shape_
 
Tensor::Strides save_invstd_strides_
 
DataType save_invstd_type_
 
bool has_weight_ {false}
 
Tensor::Shape weight_shape_
 
Tensor::Strides weight_strides_
 
DataType weight_type_ {DataType::kFloat32}
 
bool has_bias_ {false}
 
Tensor::Shape bias_shape_
 
Tensor::Strides bias_strides_
 
DataType bias_type_ {DataType::kFloat32}
 
bool has_running_mean_ {false}
 
Tensor::Shape running_mean_shape_
 
Tensor::Strides running_mean_strides_
 
DataType running_mean_type_ {DataType::kFloat32}
 
bool has_running_var_ {false}
 
Tensor::Shape running_var_shape_
 
Tensor::Strides running_var_strides_
 
DataType running_var_type_ {DataType::kFloat32}
 
bool training_ {}
 
double momentum_ {}
 
double eps_ {}
 
int device_index_ {0}
 
- Protected Attributes inherited from infini::ops::OperatorBase
std::unique_ptr< Handle > handle_ptr_
 
std::unique_ptr< Config > config_ptr_
 
void * stream_ {nullptr}
 
void * workspace_ {nullptr}
 
std::size_t workspace_size_in_bytes_ {0}
 

Additional Inherited Members

- Static Public Member Functions inherited from infini::ops::Operator< NativeBatchNorm >
static void clear_cache ()
 
static void clear_cache ()
 
static std::unique_ptr< Operator > Make (const Config &config, const Tensor tensor, Args &&... args)
 
static std::unique_ptr< Operator > Make (const Tensor tensor, Args &&... args)
 
static std::unique_ptr< Operator > Make (const Config &config, const std::vector< Tensor > tensors, Args &&... args)
 
static std::unique_ptr< Operator > Make (const std::vector< Tensor > tensors, Args &&... args)
 
static std::unique_ptr< Operator > Make (const Config &config, const Tensor tensor, Args &&... args)
 
static std::unique_ptr< Operator > Make (const Tensor tensor, Args &&... args)
 
static std::unique_ptr< Operator > Make (const Config &config, const std::vector< Tensor > tensors, Args &&... args)
 
static std::unique_ptr< Operator > Make (const std::vector< Tensor > tensors, Args &&... args)
 
static void Call (const Handle &handle, const Config &config, const Args &... args)
 
static void Call (const Tensor tensor, const Args &... args)
 
static auto Call (const TensorLike &tensor, const Args &... args)
 
static void Call (const Handle &handle, const Config &config, const Args &... args)
 
static void Call (const Tensor tensor, const Args &... args)
 
static auto Call (const TensorLike &tensor, const Args &... args)
 
static std::vector< std::size_t > active_implementation_indices (Device::Type dev_type)
 
static std::vector< std::size_t > active_implementation_indices (Device::Type dev_type)
 
- Static Protected Attributes inherited from infini::ops::Operator< NativeBatchNorm >
static constexpr Device::Type device_type_
 
static constexpr std::size_t implementation_index_
 

Constructor & Destructor Documentation

◆ NativeBatchNorm()

infini::ops::NativeBatchNorm::NativeBatchNorm ( const Tensor  input,
const std::optional< Tensor >  weight,
const std::optional< Tensor >  bias,
const std::optional< Tensor >  running_mean,
const std::optional< Tensor >  running_var,
const bool  training,
const double  momentum,
const double  eps,
Tensor  out,
Tensor  save_mean,
Tensor  save_invstd 
)
inline

Member Function Documentation

◆ operator()()

virtual void infini::ops::NativeBatchNorm::operator() ( const Tensor  input,
const std::optional< Tensor >  weight,
const std::optional< Tensor >  bias,
const std::optional< Tensor >  running_mean,
const std::optional< Tensor >  running_var,
const bool  training,
const double  momentum,
const double  eps,
Tensor  out,
Tensor  save_mean,
Tensor  save_invstd 
) const
pure virtual

Member Data Documentation

◆ bias_shape_

Tensor::Shape infini::ops::NativeBatchNorm::bias_shape_
protected

◆ bias_strides_

Tensor::Strides infini::ops::NativeBatchNorm::bias_strides_
protected

◆ bias_type_

DataType infini::ops::NativeBatchNorm::bias_type_ {DataType::kFloat32}
protected

◆ device_index_

int infini::ops::NativeBatchNorm::device_index_ {0}
protected

◆ eps_

double infini::ops::NativeBatchNorm::eps_ {}
protected

◆ has_bias_

bool infini::ops::NativeBatchNorm::has_bias_ {false}
protected

◆ has_running_mean_

bool infini::ops::NativeBatchNorm::has_running_mean_ {false}
protected

◆ has_running_var_

bool infini::ops::NativeBatchNorm::has_running_var_ {false}
protected

◆ has_weight_

bool infini::ops::NativeBatchNorm::has_weight_ {false}
protected

◆ input_shape_

Tensor::Shape infini::ops::NativeBatchNorm::input_shape_
protected

◆ input_strides_

Tensor::Strides infini::ops::NativeBatchNorm::input_strides_
protected

◆ input_type_

DataType infini::ops::NativeBatchNorm::input_type_
protected

◆ momentum_

double infini::ops::NativeBatchNorm::momentum_ {}
protected

◆ out_shape_

Tensor::Shape infini::ops::NativeBatchNorm::out_shape_
protected

◆ out_strides_

Tensor::Strides infini::ops::NativeBatchNorm::out_strides_
protected

◆ out_type_

DataType infini::ops::NativeBatchNorm::out_type_
protected

◆ running_mean_shape_

Tensor::Shape infini::ops::NativeBatchNorm::running_mean_shape_
protected

◆ running_mean_strides_

Tensor::Strides infini::ops::NativeBatchNorm::running_mean_strides_
protected

◆ running_mean_type_

DataType infini::ops::NativeBatchNorm::running_mean_type_ {DataType::kFloat32}
protected

◆ running_var_shape_

Tensor::Shape infini::ops::NativeBatchNorm::running_var_shape_
protected

◆ running_var_strides_

Tensor::Strides infini::ops::NativeBatchNorm::running_var_strides_
protected

◆ running_var_type_

DataType infini::ops::NativeBatchNorm::running_var_type_ {DataType::kFloat32}
protected

◆ save_invstd_shape_

Tensor::Shape infini::ops::NativeBatchNorm::save_invstd_shape_
protected

◆ save_invstd_strides_

Tensor::Strides infini::ops::NativeBatchNorm::save_invstd_strides_
protected

◆ save_invstd_type_

DataType infini::ops::NativeBatchNorm::save_invstd_type_
protected

◆ save_mean_shape_

Tensor::Shape infini::ops::NativeBatchNorm::save_mean_shape_
protected

◆ save_mean_strides_

Tensor::Strides infini::ops::NativeBatchNorm::save_mean_strides_
protected

◆ save_mean_type_

DataType infini::ops::NativeBatchNorm::save_mean_type_
protected

◆ training_

bool infini::ops::NativeBatchNorm::training_ {}
protected

◆ weight_shape_

Tensor::Shape infini::ops::NativeBatchNorm::weight_shape_
protected

◆ weight_strides_

Tensor::Strides infini::ops::NativeBatchNorm::weight_strides_
protected

◆ weight_type_

DataType infini::ops::NativeBatchNorm::weight_type_ {DataType::kFloat32}
protected

The documentation for this class was generated from the following file: