pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::IA3Adapter Class Reference

One layer's rescaling vector l: (out) for an output-scaling layer, (in) for a feedforward one. LinearModule owns and drives it; read it through LinearModule::ia3(). More...

#include <ia3.hpp>

Public Member Functions

 IA3Adapter (int64_t size, bool feedforward, DeviceBackend *backend, DeviceType device)
 l = 1: the layer is unchanged.
 
bool feedforward () const
 
const Tensor & scale () const
 
const Tensor & scale_grad () const
 
void set_scale (const std::vector< float > &values)
 Replaces l.
 
bool merged () const
 
bool enabled () const
 

Friends

class LinearModule
 

Detailed Description

One layer's rescaling vector l: (out) for an output-scaling layer, (in) for a feedforward one. LinearModule owns and drives it; read it through LinearModule::ia3().

Constructor & Destructor Documentation

◆ IA3Adapter()

pulsatrix::IA3Adapter::IA3Adapter ( int64_t  size,
bool  feedforward,
DeviceBackend *  backend,
DeviceType  device 
)

l = 1: the layer is unchanged.

Member Function Documentation

◆ enabled()

bool pulsatrix::IA3Adapter::enabled ( ) const
inline

◆ feedforward()

bool pulsatrix::IA3Adapter::feedforward ( ) const
inline

◆ merged()

bool pulsatrix::IA3Adapter::merged ( ) const
inline

◆ scale()

const Tensor & pulsatrix::IA3Adapter::scale ( ) const
inline

◆ scale_grad()

const Tensor & pulsatrix::IA3Adapter::scale_grad ( ) const
inline

◆ set_scale()

void pulsatrix::IA3Adapter::set_scale ( const std::vector< float > &  values)

Replaces l.

Exceptions
std::invalid_argumenton a wrong size.

Friends And Related Symbol Documentation

◆ LinearModule

friend class LinearModule
friend

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