MCPcopy Create free account
hub / github.com/tensorflow/tfjs / createOpAttr

Function createOpAttr

tfjs-node/src/nodejs_kernel_backend.ts:757–764  ·  view source on GitHub ↗
(
    attrName: string, tensorsOrDtype: tf.Tensor|tf.Tensor[]|tf.DataType,
    value: ScalarLike)

Source from the content-addressed store, hash-verified

755
756// TODO(yassogba) remove? who uses this?
757export function createOpAttr(
758 attrName: string, tensorsOrDtype: tf.Tensor|tf.Tensor[]|tf.DataType,
759 value: ScalarLike): TFEOpAttr {
760 if (isNullOrUndefined(tensorsOrDtype)) {
761 throw new Error('Invalid input tensors value.');
762 }
763 return {name: attrName, type: nodeBackend().binding.TF_BOOL, value};
764}
765
766/** Returns the dtype number for a single or list of input Tensors. */
767function getTFDTypeForInputs(tensors: tf.Tensor|tf.Tensor[]): number {

Callers

nothing calls this directly

Calls 1

nodeBackendFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…