IEProtLib/tf_ops/cc/src/compute_topo_dist.cpp
/**
             *  Constructor.
             *  @param  pContext    Constructor context of the operation.
             */
Constructor.
@param  pContext    Constructor context of the operation.
Constructor . @param pContext Constructor context of the operation .
explicit ComputeTopoDistOp(
                OpKernelConstruction* pContext)
                :OpKernel(pContext){
                OP_REQUIRES_OK(pContext, pContext->GetAttr("max_dist", &maxDist_));
                OP_REQUIRES(pContext, maxDist_ > 0.0, 
                    errors::InvalidArgument("ComputeTopoDist requires positive max distance."));
                int constEdge;
                OP_REQUIRES_OK(pContext, pContext->GetAttr("const_edge", &constEdge));
                OP_REQUIRES(pContext, constEdge == 0 || constEdge == 1, 
                    errors::InvalidArgument("ComputeTopoDist requires const_edge equal to 1 or 0."));
                constEdge_ = constEdge == 1;
            }
explicit ComputeTopoDistOp ( OpKernelConstruction * pContext ) : OpKernel ( pContext ) { OP_REQUIRES_OK ( pContext , pContext -> GetAttr ( " " , & maxDist_ ) ) ; OP_REQUIRES ( pContext , maxDist_ > 0.0 , errors :: InvalidArgument ( " " ) ) ; int constEdge ; OP_REQUIRES_OK ( pContext , pContext -> GetAttr ( " " , & constEdge ) ) ; OP_REQUIRES ( pContext , constEdge == 0 || constEdge == 1 , errors :: InvalidArgument ( " " ) ) ; constEdge_ = constEdge == 1 ; }
Constructor.
Constructor .