def METHOD_NAME(lbann):
    """Construct LBANN model.
    Args:
        lbann (module): Module for LBANN Python frontend
    """
    # Input data
    # Note: Slice to separate the last entry in the input tensor. Sum
    # with a weights layer so that gradient checking will verify that
    # error signals are correct.
    x = lbann.Input(data_field='samples')
    x = lbann.Slice(x, slice_points=[0,_sample_size-1,_sample_size])
    x1 = lbann.Identity(x)
    x2 = lbann.Identity(x)
    x1_weights = lbann.Weights(
        optimizer=lbann.SGD(),
        initializer=lbann.ConstantInitializer(value=0.0),
        name='input_weights')
    x1 = lbann.Sum(x1, lbann.WeightsLayer(weights=x1_weights, hint_layer=x1))
    x1_lbann = x1
    x2_lbann = x2
    # Objects for LBANN model
    obj = []
    metrics = []
    callbacks = []
    # ------------------------------------------
    # Compute expected metric values with NumPy
    # ------------------------------------------
    vals_sum = []
    vals_mean = []
    for i in range(num_samples()):
        x = get_sample(i).astype(np.float64)
        x1 = x[:-1]
        x2 = x[-1]
        y_sum = np.sum(x1)
        z_sum = y_sum * x2
        y_mean = np.mean(x1)
        z_mean = y_mean * x2
        vals_sum.append(z_sum)
        vals_mean.append(z_mean)
    val_sum = np.mean(vals_sum)
    val_mean = np.mean(vals_mean)
    tol = 2 * _sample_size * np.finfo(np.float32).eps
    # ------------------------------------------
    # Data-parallel layout, sum reduction
    # ------------------------------------------
    x1 = x1_lbann
    x2 = x2_lbann
    y = lbann.Reduction(x1, mode='sum', data_layout='data_parallel')
    z = lbann.Multiply(y, x2)
    obj.append(z)
    metrics.append(lbann.Metric(z, name='data-parallel layout, sum reduction'))
    callbacks.append(
        lbann.CallbackCheckMetric(
            metric=metrics[-1].name,
            lower_bound=val_sum-tol,
            upper_bound=val_sum+tol,
            error_on_failure=True,
            execution_modes='test',
        )
    )
    # ------------------------------------------
    # Data-parallel layout, mean reduction
    # ------------------------------------------
    x1 = x1_lbann
    x2 = x2_lbann
    y = lbann.Reduction(x1, mode='mean', data_layout='data_parallel')
    z = lbann.Multiply(y, x2)
    obj.append(z)
    metrics.append(lbann.Metric(z, name='data-parallel layout, mean reduction'))
    callbacks.append(
        lbann.CallbackCheckMetric(
            metric=metrics[-1].name,
            lower_bound=val_mean-tol,
            upper_bound=val_mean+tol,
            error_on_failure=True,
            execution_modes='test',
        )
    )
    # ------------------------------------------
    # Model-parallel layout, sum reduction
    # ------------------------------------------
    x1 = x1_lbann
    x2 = x2_lbann
    y = lbann.Reduction(x1, mode='sum', data_layout='model_parallel')
    z = lbann.Multiply(y, x2)
    obj.append(z)
    metrics.append(lbann.Metric(z, name='model-parallel layout, sum reduction'))
    callbacks.append(
        lbann.CallbackCheckMetric(
            metric=metrics[-1].name,
            lower_bound=val_sum-tol,
            upper_bound=val_sum+tol,
            error_on_failure=True,
            execution_modes='test',
        )
    )
    # ------------------------------------------
    # Data-parallel layout, mean reduction
    # ------------------------------------------
    x1 = x1_lbann
    x2 = x2_lbann
    y = lbann.Reduction(x1, mode='mean', data_layout='model_parallel')
    z = lbann.Multiply(y, x2)
    obj.append(z)
    metrics.append(lbann.Metric(z, name='model-parallel layout, mean reduction'))
    callbacks.append(
        lbann.CallbackCheckMetric(
            metric=metrics[-1].name,
            lower_bound=val_mean-tol,
            upper_bound=val_mean+tol,
            error_on_failure=True,
            execution_modes='test',
        )
    )
    # ------------------------------------------
    # Gradient checking
    # ------------------------------------------
    callbacks.append(lbann.CallbackCheckGradients(error_on_failure=True))
    # ------------------------------------------
    # Construct model
    # ------------------------------------------
    num_epochs = 0
    return lbann.Model(num_epochs,
                       layers=x1_lbann,
                       objective_function=obj,
                       metrics=metrics,
                       callbacks=callbacks)