import tensorflow as tf


from tensorflow.python.framework import ops
from collections import namedtuple

import logger
from tf_conv_dims import calc_padding_4d, calc_out_size_4d, calc_out_size_4d_np

log = logger.get()

sbnet_module = tf.load_op_library('../sbnet_ops/libsbnet.so')

BlockParams = namedtuple('BlockParams', ['bsize', 'bsize_out', 'boffset', 'bcount', 'bstrides'])


# Gradients registration.
@ops.RegisterGradient("SparseGather")
def _sparse_gather_grad(op, grad):
    # x is shaped like full tensor [NHWC]
