from tensorflow.python.framework import ops

		sp_indices = [sp_m.indices for sp_m in sp_matrices]
		sp_values = [sp_m.values for sp_m in sp_matrices]
		sp_shape = [sp_m.dense_shape for sp_m in sp_matrices]

		return self.b_module.bspmdt(sp_ids = sp_indices, sp_values = sp_values, sp_shape = sp_shape, rhs = dense_matrices, adjoint_a = adjoint_a, adjoint_b = adjoint_b)

b_module = tf.load_op_library('./batched.so')

@ops.RegisterGradient("Bspmdt")
def _bspmdt_grad(op, *grad):

  """Gradients for the dense tensors in the SparseTensorDenseMatMul ops.
  Args:
    op: the Bspmdt ops
    grads: the incoming gradients

