'Build the graph for this configuration.
Args:
inputs: A dict of inputs. For training, should contain \'wav\'.
is_training: Whether we are training or not. Not used in this config.
Returns:
A dict of outputs that includes the \'predictions\', \'loss\', the \'encoding\',
the \'quantized_input\', and whatever metrics we want to track for eval.'

def build(self, inputs, is_training):

    del is_training
    num_stages = 10
    num_layers = 30
    filter_length = 3
    width = 512
    skip_width = 256
    ae_num_stages = 10
    ae_num_layers = 30
    ae_filter_length = 3
    ae_width = 128
    x = inputs['wav']
    x_quantized = utils.mu_law(x)
    x_scaled = (tf.cast(x_quantized, tf.float32) / 128.0)
    x_scaled = tf.expand_dims(x_scaled, 2)
    en = masked.conv1d(x_scaled, causal=False, num_filters=ae_width, filter_length=ae_filter_length, name='ae_startconv')
    for num_layer in xrange(ae_num_layers):
        dilation = (2 ** (num_layer % ae_num_stages))
        d = tf.nn.relu(en)
        d = masked.conv1d(d, causal=False, num_filters=ae_width, filter_length=ae_filter_length, dilation=dilation, name=('ae_dilatedconv_%d' % (num_layer + 1)))
        d = tf.nn.relu(d)
        en += masked.conv1d(d, num_filters=ae_width, filter_length=1, name=('ae_res_%d' % (num_layer + 1)))
    en = masked.conv1d(en, num_filters=self.ae_bottleneck_width, filter_length=1, name='ae_bottleneck')
    en = masked.pool1d(en, self.ae_hop_length, name='ae_pool', mode='avg')
    encoding = en
    l = masked.shift_right(x_scaled)
    l = masked.conv1d(l, num_filters=width, filter_length=filter_length, name='startconv')
    s = masked.conv1d(l, num_filters=skip_width, filter_length=1, name='skip_start')
    for i in xrange(num_layers):
        dilation = (2 ** (i % num_stages))
        d = masked.conv1d(l, num_filters=(2 * width), filter_length=filter_length, dilation=dilation, name=('dilatedconv_%d' % (i + 1)))
        d = self._condition(d, masked.conv1d(en, num_filters=(2 * width), filter_length=1, name=('cond_map_%d' % (i + 1))))
        assert ((d.get_shape().as_list()[2] % 2) == 0)
        m = (d.get_shape().as_list()[2] // 2)
        d_sigmoid = tf.sigmoid(d[:, :, :m])
        d_tanh = tf.tanh(d[:, :, m:])
        d = (d_sigmoid * d_tanh)
        l += masked.conv1d(d, num_filters=width, filter_length=1, name=('res_%d' % (i + 1)))
        s += masked.conv1d(d, num_filters=skip_width, filter_length=1, name=('skip_%d' % (i + 1)))
    s = tf.nn.relu(s)
    s = masked.conv1d(s, num_filters=skip_width, filter_length=1, name='out1')
    s = self._condition(s, masked.conv1d(en, num_filters=skip_width, filter_length=1, name='cond_map_out1'))
    s = tf.nn.relu(s)
    logits = masked.conv1d(s, num_filters=256, filter_length=1, name='logits')
    logits = tf.reshape(logits, [(-1), 256])
    probs = tf.nn.softmax(logits, name='softmax')
    x_indices = (tf.cast(tf.reshape(x_quantized, [(-1)]), tf.int32) + 128)
    loss = tf.reduce_mean(tf.nn.sparse_softmax_cross_entropy_with_logits(logits=logits, labels=x_indices, name='nll'), 0, name='loss')
    return {'predictions': probs, 'loss': loss, 'eval': {'nll': loss}, 'quantized_input': x_quantized, 'encoding': encoding}
