[][src]Function onednn_sys::dnnl_primitive_attr_set_scales

pub unsafe extern "C" fn dnnl_primitive_attr_set_scales(
    attr: dnnl_primitive_attr_t,
    arg: c_int,
    count: dnnl_dim_t,
    mask: c_int,
    scales: *const f32
) -> dnnl_status_t

Sets primitive attributes scaling factors for primitive operations for a given memory argument.

@sa dnnl_primitive_attr_set_output_scales

@param attr Primitive attributes. @param arg Parameter argument index as passed to the dnnl_primitive_execute() call. @param count Length of the array of scaling factors @p scales. @param mask Scaling factors correspondence mask that defines the correspondence between the tensor dimensions and the @p scales array. The set i-th bit indicates that a dedicated scaling factor is used for each index along that dimension. Set the mask to 0 to use a common scaling factor for the whole output tensor. @param scales Constant array of float scaling factors. This array must contain @p count scales and the following equality must hold: \f[count = \prod\limits_{d \in mask} output.dims[d].\f] @returns #dnnl_success on success and a status describing the error otherwise.