import tensorflow as tf

    # Currently we do not support strides > 1 in this matrix multiplication mode. Could be supported
    # in the future.
    assert_strides = tf.assert_equal(
        tf.cast(tf.stack([strides[1], strides[2]]), tf.int64),
        tf.constant([1, 1], dtype=tf.int64),
        message='Strides > 1 not supported.')

    # Convolution when number of indices is larger than zero.
