(args?: PReLULayerArgs)
| 146 | readonly DEFAULT_ALPHA_INITIALIZER: InitializerIdentifier = 'zeros'; |
| 147 | |
| 148 | constructor(args?: PReLULayerArgs) { |
| 149 | super(args == null ? {} : args); |
| 150 | if (args == null) { |
| 151 | args = {}; |
| 152 | } |
| 153 | |
| 154 | this.supportsMasking = true; |
| 155 | this.alphaInitializer = |
| 156 | getInitializer(args.alphaInitializer || this.DEFAULT_ALPHA_INITIALIZER); |
| 157 | this.alphaRegularizer = getRegularizer(args.alphaRegularizer); |
| 158 | this.alphaConstraint = getConstraint(args.alphaConstraint); |
| 159 | if (args.sharedAxes == null) { |
| 160 | this.sharedAxes = null; |
| 161 | } else if (Array.isArray(args.sharedAxes)) { |
| 162 | this.sharedAxes = args.sharedAxes; |
| 163 | } else if (typeof args.sharedAxes === 'number') { |
| 164 | this.sharedAxes = [args.sharedAxes]; |
| 165 | } else { |
| 166 | throw new ValueError( |
| 167 | `Expected sharedAxes to be a number or an array of numbers, ` + |
| 168 | `but got ${args.sharedAxes}`); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | override build(inputShape: Shape|Shape[]) { |
| 173 | inputShape = getExactlyOneShape(inputShape); |
nothing calls this directly
no test coverage detected