Loading TOC...

cntk.constantCloneAs

cntk.constantCloneAs(
   $constant as cntk.constant,
   $data-type as cntk.dataType
) 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

  var constant1 = cntk.constant(cntk.shape([2,3]), "float", 55.55, cntk.cpu(),
    "new_constant")
  cntk.constantCloneAs(constant1, "double")
  => 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.