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

Function pack

tfjs-node/src/kernels/Pack.ts:21–35  ·  view source on GitHub ↗
(
    args: {inputs: PackInputs, backend: NodeJSKernelBackend, attrs: PackAttrs})

Source from the content-addressed store, hash-verified

19import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend';
20
21export function pack(
22 args: {inputs: PackInputs, backend: NodeJSKernelBackend, attrs: PackAttrs}):
23 TensorInfo {
24 const {inputs, backend, attrs} = args;
25 const {axis} = attrs;
26
27 const opAttrs = [
28 {name: 'N', type: backend.binding.TF_ATTR_INT, value: inputs.length},
29 createTensorsTypeOpAttr('T', inputs as Tensor[]),
30 {name: 'axis', type: backend.binding.TF_ATTR_INT, value: axis}
31 ];
32
33 const res = backend.executeSingleOutput(Pack, opAttrs, inputs);
34 return res;
35}
36
37export const packConfig: KernelConfig = {
38 kernelName: Pack,

Callers

nothing calls this directly

Calls 2

createTensorsTypeOpAttrFunction · 0.90
executeSingleOutputMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…