Loading TOC...

cntk:as-block

cntk:as-block(
   $composite as cntk:function,
   $arguments-map as json:array,
   $block-op-name as xs:string,
   [$block-name as xs:string]
) as cntk:function

Summary

Create a new block Function instance which just encapsulates the specified composite Function to create a new Function that appears to be a primitive. All the arguments of the composite being encapsulated must be Placeholder variables. The purpose of block Functions is to enable creation of hierarchical Function graphs where details of implementing certain building block operations can be encapsulated away such that the actual structure of the block’s implementation is not inlined into the parent graph where the block is used, and instead the block just appears as an opaque primitive. Users still have the ability to peek at the underlying Function graph that implements the actual block Function.

Parameters
$composite The composite Function that the block encapsulates.
$arguments-map A list of tuples, mapping from block’s underlying composite’s arguments to actual variables they are connected to.
$block-op-name Name of the op that the block represents.
$block-name The name of the block Function in the network.

Example

  let $input-variable := cntk:input-variable(cntk:shape((3)), "float",
    fn:false(), fn:false(), "feature")
  let $placeholder := cntk:placeholder-variable()
  return cntk:as-block(cntk:negate($placeholder, "hi"),
    json:to-array(($placeholder, $input-variable)), "g", "S")
  => cntk:function(Composite g (Input(Name(feature), Shape([3]), Dynamic
  Axes([Sequence Axis(Default Dynamic Axis), Batch Axis(Default Batch Axis)]))))

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.