Loading TOC...

cntk.times

cntk.times(
   $left-operand as cntk.variable,
   $right-operand as cntk.variable,
   $output-rank as Number,
   $infer-input-rank-to-map as Number,
   $name as String
) as cntk.function

Summary

The output of this operation is the matrix product of the two input matrices. It supports broadcasting. Sparse is supported in the left operand, if it is a matrix. The operator ‘@’ has been overloaded such that in Python 3.5 and later X @ W equals times(X, W).

Parameters
$left-operand The left operand of the operation.
$right-operand The right operand of the operation.
$output-rank In case we have tensors as arguments, output_rank represents the number of axes to be collapsed in order to transform the tensors into matrices, perform the operation and then reshape back (explode the axes)
$infer-input-rank-to-map Meant for internal use only. Always use default value.
$name The name of the function instance in the network.

Example

  var inputVariable1 = cntk.inputVariable(cntk.shape([3]), "float", fn.false(),
    fn.false(), "feature")
  var inputVariable2 = cntk.inputVariable(cntk.shape([3]), "float", fn.false(),
    fn.false(), "feature")
  cntk.times(inputVariable1, inputVariable2, 1, -1)
  => cntk.function(Composite Times (Input(Name(feature), Shape([3]),
  Dynamic Axes([Sequence Axis(Default Dynamic Axis), Batch Axis(Default Batch Axis)])),
  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.