• Register an Op for graph model executor. This allows you to register TensorFlow custom op or override existing op.

    Here is an example of registering a new MatMul Op.

    const customMatmul = (node) =>
    tf.matMul(
    node.inputs[0], node.inputs[1],
    node.attrs['transpose_a'], node.attrs['transpose_b']);

    tf.registerOp('MatMul', customMatmul);

    The inputs and attrs of the node object are based on the TensorFlow op registry.

    Parameters

    • name: string

      The Tensorflow Op name.

    • opFunc: OpExecutor

      An op function which is called with the current graph node during execution and needs to return a tensor or a list of tensors. The node has the following attributes:

      • attr: A map from attribute name to its value
      • inputs: A list of input tensors

    Returns void

    Doc

Generated using TypeDoc