Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some inheritance opening needed in a particular project #2231

Merged
merged 1 commit into from
Dec 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/src/main/java/ai/djl/nn/convolutional/Conv2d.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class Conv2d extends Convolution {
private static final String STRING_LAYOUT = "NCHW";
private static final int NUM_DIMENSIONS = 4;

Conv2d(Builder builder) {
protected Conv2d(Builder builder) {
super(builder);
}

Expand Down Expand Up @@ -201,10 +201,10 @@ public static Builder builder() {
}

/** The Builder to construct a {@link Conv2d} type of {@link Block}. */
public static final class Builder extends ConvolutionBuilder<Builder> {
public static class Builder extends ConvolutionBuilder<Builder> {

/** Creates a builder that can build a {@link Conv2d} block. */
Builder() {
protected Builder() {
stride = new Shape(1, 1);
padding = new Shape(0, 0);
dilation = new Shape(1, 1);
Expand Down
8 changes: 4 additions & 4 deletions api/src/main/java/ai/djl/nn/core/Linear.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public class Linear extends AbstractBlock {
private Parameter weight;
private Parameter bias;

Linear(Builder builder) {
protected Linear(Builder builder) {
super(VERSION);
units = builder.units;
weight =
Expand Down Expand Up @@ -202,12 +202,12 @@ public static Builder builder() {
}

/** The Builder to construct a {@link Linear} type of {@link Block}. */
public static final class Builder {
public static class Builder {

private long units;
protected long units;
private boolean bias = true;

Builder() {}
protected Builder() {}

/**
* Sets the number of output channels.
Expand Down
18 changes: 9 additions & 9 deletions api/src/main/java/ai/djl/nn/norm/LayerNorm.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@
*/
public class LayerNorm extends AbstractBlock {

private float epsilon;
private Shape normalizedShape;
protected float epsilon;
protected Shape normalizedShape;

private boolean center;
private boolean scale;
private int[] axis;
private Parameter gamma;
private Parameter beta;
protected boolean center;
protected boolean scale;
protected int[] axis;
protected Parameter gamma;
protected Parameter beta;

LayerNorm(Builder builder) {
protected LayerNorm(Builder builder) {
epsilon = builder.epsilon;
scale = builder.scale;
center = builder.center;
Expand Down Expand Up @@ -186,7 +186,7 @@ public static final class Builder {
private boolean center = true;
private int[] axis;

Builder() {}
protected Builder() {}

/**
* List the axis over which the mean and variance will be calculated (alternative to
Expand Down