class nbla::Prod

template<typename T>
class Prod : public nbla::Sum<T>

Reduction along axes with product operation.

Note

Backward computation is not accurate in a zero value input.

Template Parameters:

T – Data type for computation.

Param axes:

A list of axes to be reduced.

Param keep_dims:

Flag whether the reduced axes are kept.

Public Functions

inline virtual shared_ptr<Function> copy() const

Copy another instance of Function with the same context.

inline virtual string name()

Get function name in string.

inline virtual bool grad_depends_output_data(int i, int o) const

Dependency flag for checking if in-grad depends on out-data.

Checking if i-th input’ gradient computation requires o-th output’s data or not.

Note

If any of inputs requires an output variable data when computing its gradient, this function must be overridden to return appropriate boolean value. Otherwise, backward computation will be incorrect.

Parameters:
  • i[in] Input variable index.

  • o[in] Output variable index.