Loading TOC...

cntk:constant-clone-as

cntk:constant-clone-as(
   $constant as cntk:constant,
   $data-type as cntk:data-type
) as cntk:constant

Summary

Clone the constant as a different data type. Can only convert to higher precision types (currently only float to double).

Parameters
$constant The constant to be cloned.
$data-type The data-type to convert to.

Example

  let $constant1 := cntk:constant(cntk:shape((2,3)), "float", 55.55, cntk:cpu(),
    "new_constant")
  let $rs := cntk:constant-clone-as($constant1, "double")
  return fn:replace(xdmp:quote($rs), "0x[a-z|A-Z|0-9]*", "Value")
  => cntk:constant(Constant(Name(new_constant), Shape([2 x 3]), Dynamic Axes([])))

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