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

Method computeOutputShape

tfjs-layers/src/layers/convolutional.ts:1399–1411  ·  view source on GitHub ↗
(inputShape: Shape)

Source from the content-addressed store, hash-verified

1397 }
1398
1399 override computeOutputShape(inputShape: Shape): Shape {
1400 if (this.dataFormat === 'channelsFirst') {
1401 const height =
1402 inputShape[2] == null ? null : this.size[0] * inputShape[2];
1403 const width = inputShape[3] == null ? null : this.size[1] * inputShape[3];
1404 return [inputShape[0], inputShape[1], height, width];
1405 } else {
1406 const height =
1407 inputShape[1] == null ? null : this.size[0] * inputShape[1];
1408 const width = inputShape[2] == null ? null : this.size[1] * inputShape[2];
1409 return [inputShape[0], height, width, inputShape[3]];
1410 }
1411 }
1412
1413 override call(inputs: Tensor|Tensor[], kwargs: Kwargs): Tensor|Tensor[] {
1414 return tfc.tidy(() => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected