Exemplo n.º 1
0
 def __init__(self, name: Optional[str], axis: Axis):
     super().__init__(name)
     self.parameters["axis"] = axis
     self.attributes = {PostAxiswise(self, Axis.C),
                        Axiswise(self, Axis.C),
                        Inplace(self, "x", "y"),
                        HaveWeights(self)}
Exemplo n.º 2
0
    def __init__(self, name: Optional[str]):
        super().__init__(name)

        # FIXME: attributes set may be overwritten in extended class's constructor
        self.attributes = {
            ElementwiseAttribute(self),
            Inplace(self, "x0", "y")
        }
Exemplo n.º 3
0
    def __init__(self, name: Optional[str], in_order: Order, out_order: Order, out_shape: List[Union[int, Placeholder]]):
        super().__init__(name)

        assert -1 not in out_shape, "-1 (wildcard) in reshape output shape is currently not supported"

        self.parameters["in_order"] = in_order
        self.parameters["out_order"] = out_order
        self.parameters["out_shape"] = out_shape

        self.attributes.add(Inplace(self, "x", "y"))
Exemplo n.º 4
0
    def __init__(self, name: Optional[str], in_axes: List[Axis],
                 out_axis: Axis):
        # in_axes: [Axis.H, Axis.W, Axis.C], out_axes: Axis.C
        # のとき、NHWC入力・NC出力ならデータを操作しないでorder=NCの出力とする。
        # NCHW入力・NC出力なら、入力データをNHWCに並び替えたうえでorder=NCの出力とする。

        super().__init__(name)

        self.parameters["in_axes"] = in_axes
        self.parameters["out_axis"] = out_axis
        self.attributes = {Elementwise(self), Inplace(self, "x", "y")}
Exemplo n.º 5
0
 def __init__(self, name: Optional[str], n: float, k: float, alpha: float,
              beta: float):
     super().__init__(name)
     self.parameters["n"] = n
     self.parameters["k"] = k
     self.parameters["alpha"] = alpha
     self.parameters["beta"] = beta
     self.attributes = {
         PostAxiswise(self, Axis.C),
         Axiswise(self, Axis.C),
         Inplace(self, "x", "y")
     }
Exemplo n.º 6
0
 def __init__(self, name: Optional[str]):
     super().__init__(name)
     self.attributes = {Elementwise(self), Inplace(self, "x", "y")}
Exemplo n.º 7
0
    def __init__(self, name: Optional[str]):
        super().__init__(name)

        self.attributes.add(ElementwiseAttribute(self))
        self.attributes.add(Inplace(self, "x0", "y"))
Exemplo n.º 8
0
 def __init__(self, name: Optional[str], axis: Axis):
     super().__init__(name)
     self.parameters["axis"] = axis
     self.attributes = {Inplace(self, "x", "y")}
Exemplo n.º 9
0
 def __init__(self, name: Optional[str], scale: float, bias: float):
     super().__init__(name)
     self.scale = scale
     self.bias = bias
     self.attributes = {Elementwise(self), Inplace(self, "x", "y")}