class nbla::Max

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

Reduction along axes with max operation.

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.

Subclassed by nbla::Min< T >

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.

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

Dependency flag to check if in-grad depends on out-data for auto grad.

Checking if i-th input’s gradient computation requires o-th output’s data or not when auto grad (nnabla.grad). This method is refered in auto-forward mode to clear memory consumption dynamically.

Note

If the grad dependencies of the output are different between Function::backward and auto grad, this function must be overridden to return appropriate boolean value. Otherwise, auto grad computation will be incorrect.

Parameters:
  • i[in] Input variable index.

  • o[in] Output variable index.