|
|
|
@ -17,6 +17,7 @@ All layers just related to the neural network.
|
|
|
|
|
|
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
|
|
import numpy as np
|
|
|
|
|
from ..layer_helper import LayerHelper
|
|
|
|
|
from ..initializer import Normal, Constant
|
|
|
|
|
from ..framework import Variable
|
|
|
|
@ -24,7 +25,6 @@ from ..param_attr import ParamAttr
|
|
|
|
|
from .layer_function_generator import autodoc, templatedoc
|
|
|
|
|
from .tensor import concat
|
|
|
|
|
from . import utils
|
|
|
|
|
import random
|
|
|
|
|
from .. import unique_name
|
|
|
|
|
from functools import reduce
|
|
|
|
|
|
|
|
|
@ -5102,7 +5102,7 @@ def random_crop(x, shape, seed=None):
|
|
|
|
|
dtype = x.dtype
|
|
|
|
|
out = helper.create_tmp_variable(dtype)
|
|
|
|
|
if seed is None:
|
|
|
|
|
seed = random.randint(-65536, 65535)
|
|
|
|
|
seed = np.random.randint(-65536, 65536)
|
|
|
|
|
op_attrs = {"shape": shape}
|
|
|
|
|
if isinstance(seed, int):
|
|
|
|
|
op_attrs["startup_seed"] = seed
|
|
|
|
|