def _diagonal_hessian(self, grads, predictions):
    'Prepares hessians for diagonal-hessian multiclass mode.'
    diag_hessian_list = []
    gradients_list = array_ops.unstack(grads, num=self._logits_dimension, axis=1)
    for (row, row_grads) in enumerate(gradients_list):
        hessian_row = gradients_impl.gradients(row_grads, predictions, name=('Hessian_%d' % row), colocate_gradients_with_ops=False, gate_gradients=0, aggregation_method=None)
        hessian_row = array_ops.squeeze(array_ops.unstack(hessian_row), [0])
        elem = array_ops.transpose(hessian_row)[row]
        diag_hessian_list.append(elem)
    return diag_hessian_list
Prepares hessians for diagonal-hessian multiclass mode.
def _diagonal_hessian(self, grads, predictions):
    
    diag_hessian_list = []
    gradients_list = array_ops.unstack(grads, num=self._logits_dimension, axis=1)
    for (row, row_grads) in enumerate(gradients_list):
        hessian_row = gradients_impl.gradients(row_grads, predictions, name=('Hessian_%d' % row), colocate_gradients_with_ops=False, gate_gradients=0, aggregation_method=None)
        hessian_row = array_ops.squeeze(array_ops.unstack(hessian_row), [0])
        elem = array_ops.transpose(hessian_row)[row]
        diag_hessian_list.append(elem)
    return diag_hessian_list