MCPcopy
hub / github.com/tensorflow/tfjs / build

Method build

tfjs-layers/src/layers/wrappers.ts:158–172  ·  view source on GitHub ↗
(inputShape: Shape|Shape[])

Source from the content-addressed store, hash-verified

156 }
157
158 override build(inputShape: Shape|Shape[]): void {
159 inputShape = getExactlyOneShape(inputShape);
160 if (inputShape.length < 3) {
161 throw new ValueError(
162 `TimeDistributed layer expects an input shape >= 3D, but received ` +
163 `input shape ${JSON.stringify(inputShape)}`);
164 }
165 this.inputSpec = [{shape: inputShape}];
166 const childInputShape = [inputShape[0]].concat(inputShape.slice(2));
167 if (!this.layer.built) {
168 this.layer.build(childInputShape);
169 this.layer.built = true;
170 }
171 super.build(inputShape);
172 }
173
174 override computeOutputShape(inputShape: Shape|Shape[]): Shape|Shape[] {
175 inputShape = getExactlyOneShape(inputShape);

Callers

nothing calls this directly

Calls 4

getExactlyOneShapeFunction · 0.90
concatMethod · 0.65
sliceMethod · 0.65
buildMethod · 0.45

Tested by

no test coverage detected