Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
99342659
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
99342659
编写于
9月 04, 2018
作者:
D
dolphin8
提交者:
GitHub
9月 04, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'metal' into metal
上级
49884b2a
34bea476
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
44 addition
and
47 deletion
+44
-47
metal/paddle-mobile-demo/paddle-mobile-demo.xcodeproj/project.pbxproj
...-mobile-demo/paddle-mobile-demo.xcodeproj/project.pbxproj
+12
-12
metal/paddle-mobile-demo/paddle-mobile-demo/Net/Genet.swift
metal/paddle-mobile-demo/paddle-mobile-demo/Net/Genet.swift
+1
-1
metal/paddle-mobile-demo/paddle-mobile-demo/Net/MobileNetSSD.swift
...dle-mobile-demo/paddle-mobile-demo/Net/MobileNetSSD.swift
+5
-5
metal/paddle-mobile-demo/paddle-mobile-demo/ViewController.swift
...addle-mobile-demo/paddle-mobile-demo/ViewController.swift
+6
-6
metal/paddle-mobile/paddle-mobile.xcodeproj/xcuserdata/liuruilong.xcuserdatad/xcschemes/paddle-mobile.xcscheme
...a/liuruilong.xcuserdatad/xcschemes/paddle-mobile.xcscheme
+1
-1
metal/paddle-mobile/paddle-mobile/Executor.swift
metal/paddle-mobile/paddle-mobile/Executor.swift
+5
-5
metal/paddle-mobile/paddle-mobile/Operators/Base/Operator.swift
...paddle-mobile/paddle-mobile/Operators/Base/Operator.swift
+1
-1
metal/paddle-mobile/paddle-mobile/Operators/Kernels/BatchNormKernel.swift
...ile/paddle-mobile/Operators/Kernels/BatchNormKernel.swift
+0
-1
metal/paddle-mobile/paddle-mobile/Operators/Kernels/ConvAddKernel.swift
...obile/paddle-mobile/Operators/Kernels/ConvAddKernel.swift
+5
-5
metal/paddle-mobile/paddle-mobile/Operators/Kernels/ConvBNReluKernel.swift
...le/paddle-mobile/Operators/Kernels/ConvBNReluKernel.swift
+7
-8
metal/paddle-mobile/paddle-mobile/Operators/Kernels/SoftmaxKernel.swift
...obile/paddle-mobile/Operators/Kernels/SoftmaxKernel.swift
+0
-1
metal/paddle-mobile/paddle-mobile/framework/Texture.swift
metal/paddle-mobile/paddle-mobile/framework/Texture.swift
+1
-1
未找到文件。
metal/paddle-mobile-demo/paddle-mobile-demo.xcodeproj/project.pbxproj
浏览文件 @
99342659
...
@@ -494,19 +494,19 @@
...
@@ -494,19 +494,19 @@
buildSettings
=
{
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CLANG_ENABLE_MODULES
=
YES
;
CLANG_ENABLE_MODULES
=
YES
;
CODE_SIGN_IDENTITY
=
"iPhone D
eveloper
"
;
CODE_SIGN_IDENTITY
=
"iPhone D
istribution
"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Manual
;
DEVELOPMENT_TEAM
=
A798K58VVL
;
DEVELOPMENT_TEAM
=
6T9LLJKSM4
;
INFOPLIST_FILE
=
"paddle-mobile-demo/Info.plist"
;
INFOPLIST_FILE
=
"paddle-mobile-demo/Info.plist"
;
IPHONEOS_DEPLOYMENT_TARGET
=
9.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
9.0
;
LD_RUNPATH_SEARCH_PATHS
=
(
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(inherited)"
,
"@executable_path/Frameworks"
,
"@executable_path/Frameworks"
,
);
);
PRODUCT_BUNDLE_IDENTIFIER
=
"com.baidu.paddle-mobile"
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.baidu.mms.qa
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE
=
""
;
PROVISIONING_PROFILE
=
"
ba9c4b24-7bd0-49c5-93cd-e3051e775d6c
"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
PROVISIONING_PROFILE_SPECIFIER
=
Distribution_MMS
;
SWIFT_OBJC_BRIDGING_HEADER
=
"paddle-mobile-demo/paddle-mobile-demo-Bridging-Header.h"
;
SWIFT_OBJC_BRIDGING_HEADER
=
"paddle-mobile-demo/paddle-mobile-demo-Bridging-Header.h"
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
SWIFT_OPTIMIZATION_LEVEL
=
"-Onone"
;
SWIFT_VERSION
=
4.0
;
SWIFT_VERSION
=
4.0
;
...
@@ -520,19 +520,19 @@
...
@@ -520,19 +520,19 @@
buildSettings
=
{
buildSettings
=
{
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
ASSETCATALOG_COMPILER_APPICON_NAME
=
AppIcon
;
CLANG_ENABLE_MODULES
=
YES
;
CLANG_ENABLE_MODULES
=
YES
;
CODE_SIGN_IDENTITY
=
"iPhone D
eveloper
"
;
CODE_SIGN_IDENTITY
=
"iPhone D
istribution
"
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Manual
;
DEVELOPMENT_TEAM
=
A798K58VVL
;
DEVELOPMENT_TEAM
=
6T9LLJKSM4
;
INFOPLIST_FILE
=
"paddle-mobile-demo/Info.plist"
;
INFOPLIST_FILE
=
"paddle-mobile-demo/Info.plist"
;
IPHONEOS_DEPLOYMENT_TARGET
=
9.0
;
IPHONEOS_DEPLOYMENT_TARGET
=
9.0
;
LD_RUNPATH_SEARCH_PATHS
=
(
LD_RUNPATH_SEARCH_PATHS
=
(
"$(inherited)"
,
"$(inherited)"
,
"@executable_path/Frameworks"
,
"@executable_path/Frameworks"
,
);
);
PRODUCT_BUNDLE_IDENTIFIER
=
"com.baidu.paddle-mobile"
;
PRODUCT_BUNDLE_IDENTIFIER
=
com.baidu.mms.qa
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PRODUCT_NAME
=
"$(TARGET_NAME)"
;
PROVISIONING_PROFILE
=
""
;
PROVISIONING_PROFILE
=
"
ba9c4b24-7bd0-49c5-93cd-e3051e775d6c
"
;
PROVISIONING_PROFILE_SPECIFIER
=
""
;
PROVISIONING_PROFILE_SPECIFIER
=
Distribution_MMS
;
SWIFT_OBJC_BRIDGING_HEADER
=
"paddle-mobile-demo/paddle-mobile-demo-Bridging-Header.h"
;
SWIFT_OBJC_BRIDGING_HEADER
=
"paddle-mobile-demo/paddle-mobile-demo-Bridging-Header.h"
;
SWIFT_VERSION
=
4.0
;
SWIFT_VERSION
=
4.0
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
TARGETED_DEVICE_FAMILY
=
"1,2"
;
...
...
metal/paddle-mobile-demo/paddle-mobile-demo/Net/Genet.swift
浏览文件 @
99342659
...
@@ -31,7 +31,7 @@ class Genet: Net {
...
@@ -31,7 +31,7 @@ class Genet: Net {
}
}
func
resultStr
(
res
:
[
Float
])
->
String
{
func
resultStr
(
res
:
[
Float
])
->
String
{
return
"
哈哈 还没好 genet !"
;
return
"
\(
Array
<
Float
>
(
res
.
suffix
(
10
))
)
... "
}
}
var
preprocessKernel
:
CusomKernel
var
preprocessKernel
:
CusomKernel
...
...
metal/paddle-mobile-demo/paddle-mobile-demo/Net/MobileNetSSD.swift
浏览文件 @
99342659
...
@@ -48,12 +48,12 @@ class MobileNet_ssd_hand: Net{
...
@@ -48,12 +48,12 @@ class MobileNet_ssd_hand: Net{
}
}
var
scoreFormatArr
:
[
Float32
]
=
score
.
metalTexture
.
realNHWC
(
dim
:
(
n
:
score
.
padToFourDim
[
0
],
h
:
score
.
padToFourDim
[
1
],
w
:
score
.
padToFourDim
[
2
],
c
:
score
.
padToFourDim
[
3
]))
var
scoreFormatArr
:
[
Float32
]
=
score
.
metalTexture
.
realNHWC
(
dim
:
(
n
:
score
.
padToFourDim
[
0
],
h
:
score
.
padToFourDim
[
1
],
w
:
score
.
padToFourDim
[
2
],
c
:
score
.
padToFourDim
[
3
]))
print
(
"score: "
)
//
print("score: ")
print
(
scoreFormatArr
.
strideArray
())
//
print(scoreFormatArr.strideArray())
//
var
bboxArr
=
bbox
.
metalTexture
.
float32Array
()
var
bboxArr
=
bbox
.
metalTexture
.
float32Array
()
print
(
"bbox: "
)
//
print("bbox: ")
print
(
bboxArr
.
strideArray
())
//
print(bboxArr.strideArray())
let
nmsCompute
=
NMSCompute
.
init
()
let
nmsCompute
=
NMSCompute
.
init
()
nmsCompute
.
scoreThredshold
=
0.01
nmsCompute
.
scoreThredshold
=
0.01
...
...
metal/paddle-mobile-demo/paddle-mobile-demo/ViewController.swift
浏览文件 @
99342659
...
@@ -19,17 +19,18 @@ import MetalPerformanceShaders
...
@@ -19,17 +19,18 @@ import MetalPerformanceShaders
let
threadSupport
=
[
1
]
let
threadSupport
=
[
1
]
let
modelHelperMap
:
[
SupportModel
:
Net
]
=
[
.
mobilenet
:
MobileNet
.
init
(),
.
mobilenet_ssd
:
MobileNet_ssd_hand
.
init
(),
.
genet
:
Genet
.
init
()]
//.mobilenet : MobileNet.init(),
let
modelHelperMap
:
[
SupportModel
:
Net
]
=
[
.
mobilenet_ssd
:
MobileNet_ssd_hand
.
init
(),
.
genet
:
Genet
.
init
()]
//, .genet : Genet.init()
//, .genet : Genet.init()
//let modelHelperMap: [SupportModel : Net] = [.mobilenet : MobileNet.init(), .mobilenet_ssd : MobileNet_ssd_hand.init()]
//let modelHelperMap: [SupportModel : Net] = [.mobilenet : MobileNet.init(), .mobilenet_ssd : MobileNet_ssd_hand.init()]
enum
SupportModel
:
String
{
enum
SupportModel
:
String
{
case
mobilenet
=
"mobilenet"
//
case mobilenet = "mobilenet"
case
mobilenet_ssd
=
"mobilenetssd"
case
mobilenet_ssd
=
"mobilenetssd"
case
genet
=
"genet"
case
genet
=
"genet"
static
func
supportedModels
()
->
[
SupportModel
]
{
static
func
supportedModels
()
->
[
SupportModel
]
{
//
//
.mobilenet,
return
[
.
mobilenet
,
.
mobilenet
_ssd
,
.
genet
]
return
[
.
mobilenet_ssd
,
.
genet
]
}
}
}
}
...
@@ -79,7 +80,7 @@ class ViewController: UIViewController {
...
@@ -79,7 +80,7 @@ class ViewController: UIViewController {
return
return
}
}
do
{
do
{
let
max
=
1
let
max
=
50
let
startDate
=
Date
.
init
()
let
startDate
=
Date
.
init
()
for
i
in
0
..<
max
{
for
i
in
0
..<
max
{
try
net
.
predict
(
inTexture
:
inTexture
)
{
[
weak
self
]
(
result
)
in
try
net
.
predict
(
inTexture
:
inTexture
)
{
[
weak
self
]
(
result
)
in
...
@@ -87,7 +88,6 @@ class ViewController: UIViewController {
...
@@ -87,7 +88,6 @@ class ViewController: UIViewController {
fatalError
()
fatalError
()
}
}
print
(
result
.
resultArray
.
strideArray
())
if
i
==
max
-
1
{
if
i
==
max
-
1
{
let
time
=
Date
.
init
()
.
timeIntervalSince
(
startDate
)
let
time
=
Date
.
init
()
.
timeIntervalSince
(
startDate
)
DispatchQueue
.
main
.
async
{
DispatchQueue
.
main
.
async
{
...
...
metal/paddle-mobile/paddle-mobile.xcodeproj/xcuserdata/liuruilong.xcuserdatad/xcschemes/paddle-mobile.xcscheme
浏览文件 @
99342659
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
</AdditionalOptions>
</AdditionalOptions>
</TestAction>
</TestAction>
<LaunchAction
<LaunchAction
buildConfiguration =
"
Release
"
buildConfiguration =
"
Debug
"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedDebuggerIdentifier =
"Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
selectedLauncherIdentifier =
"Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle =
"0"
launchStyle =
"0"
...
...
metal/paddle-mobile/paddle-mobile/Executor.swift
浏览文件 @
99342659
...
@@ -126,11 +126,11 @@ public class Executor<P: PrecisionType> {
...
@@ -126,11 +126,11 @@ public class Executor<P: PrecisionType> {
// print(stridableInput)
// print(stridableInput)
// let _: Flo? = input.logDesc(header: "input: ", stridable: true)
// let _: Flo? = input.logDesc(header: "input: ", stridable: true)
for
i
in
0
..<
self
.
ops
.
count
{
//
for i in 0..<self.ops.count {
let
op
=
self
.
ops
[
i
]
//
let op = self.ops[i]
print
(
" 第
\(
i
)
个 op: "
)
//
print(" 第 \(i) 个 op: ")
op
.
delogOutput
()
//
op.delogOutput()
}
//
}
// return;
// return;
// self.ops[testTo - 2].delogOutput()
// self.ops[testTo - 2].delogOutput()
...
...
metal/paddle-mobile/paddle-mobile/Operators/Base/Operator.swift
浏览文件 @
99342659
...
@@ -101,7 +101,7 @@ class Operator <KernelType: Computable , ParameterType>: OperatorProtocol where
...
@@ -101,7 +101,7 @@ class Operator <KernelType: Computable , ParameterType>: OperatorProtocol where
let
scope
:
Scope
let
scope
:
Scope
var
kernel
:
KerType
var
kernel
:
KerType
required
init
(
device
:
MTLDevice
,
opDesc
:
OpDesc
,
inScope
:
Scope
)
throws
{
required
init
(
device
:
MTLDevice
,
opDesc
:
OpDesc
,
inScope
:
Scope
)
throws
{
print
(
"create op:
\(
opDesc
.
type
)
"
)
//
print("create op: \(opDesc.type)")
type
=
opDesc
.
type
type
=
opDesc
.
type
scope
=
inScope
scope
=
inScope
inputs
=
opDesc
.
inputs
inputs
=
opDesc
.
inputs
...
...
metal/paddle-mobile/paddle-mobile/Operators/Kernels/BatchNormKernel.swift
浏览文件 @
99342659
...
@@ -63,7 +63,6 @@ class BatchNormKernel<P: PrecisionType>: Kernel, Computable {
...
@@ -63,7 +63,6 @@ class BatchNormKernel<P: PrecisionType>: Kernel, Computable {
guard
let
encoder
=
commandBuffer
.
makeComputeCommandEncoder
()
else
{
guard
let
encoder
=
commandBuffer
.
makeComputeCommandEncoder
()
else
{
throw
PaddleMobileError
.
predictError
(
message
:
" encoder is nil"
)
throw
PaddleMobileError
.
predictError
(
message
:
" encoder is nil"
)
}
}
print
(
"BatchNorm compute"
)
encoder
.
setTexture
(
param
.
input
.
metalTexture
,
index
:
0
)
encoder
.
setTexture
(
param
.
input
.
metalTexture
,
index
:
0
)
encoder
.
setTexture
(
param
.
output
.
metalTexture
,
index
:
1
)
encoder
.
setTexture
(
param
.
output
.
metalTexture
,
index
:
1
)
encoder
.
setBuffer
(
newScale
,
offset
:
0
,
index
:
0
)
encoder
.
setBuffer
(
newScale
,
offset
:
0
,
index
:
0
)
...
...
metal/paddle-mobile/paddle-mobile/Operators/Kernels/ConvAddKernel.swift
浏览文件 @
99342659
...
@@ -59,14 +59,14 @@ class ConvAddKernel<P: PrecisionType>: Kernel, Computable {
...
@@ -59,14 +59,14 @@ class ConvAddKernel<P: PrecisionType>: Kernel, Computable {
let
offsetX
=
(
Int
(
param
.
dilations
[
0
])
*
(
param
.
filter
.
width
-
1
)
+
1
)
/
2
-
Int
(
param
.
paddings
[
0
])
let
offsetX
=
(
Int
(
param
.
dilations
[
0
])
*
(
param
.
filter
.
width
-
1
)
+
1
)
/
2
-
Int
(
param
.
paddings
[
0
])
print
(
" function:
\(
functionName
)
"
)
//
print(" function: \(functionName)")
print
(
"offset x:
\(
offsetX
)
"
)
//
print("offset x: \(offsetX)")
print
(
"offset y:
\(
offsetY
)
"
)
//
print("offset y: \(offsetY)")
let
offsetZ
=
0.0
let
offsetZ
=
0.0
let
inMetalParam
=
MetalConvParam
.
init
(
offsetX
:
Int16
(
offsetX
),
offsetY
:
Int16
(
offsetY
),
offsetZ
:
Int16
(
offsetZ
),
strideX
:
UInt16
(
param
.
stride
[
0
]),
strideY
:
UInt16
(
param
.
stride
[
1
]),
dilationX
:
UInt16
(
param
.
dilations
[
0
]),
dilationY
:
UInt16
(
param
.
dilations
[
1
]))
let
inMetalParam
=
MetalConvParam
.
init
(
offsetX
:
Int16
(
offsetX
),
offsetY
:
Int16
(
offsetY
),
offsetZ
:
Int16
(
offsetZ
),
strideX
:
UInt16
(
param
.
stride
[
0
]),
strideY
:
UInt16
(
param
.
stride
[
1
]),
dilationX
:
UInt16
(
param
.
dilations
[
0
]),
dilationY
:
UInt16
(
param
.
dilations
[
1
]))
print
(
"metal param: "
)
//
print("metal param: ")
print
(
inMetalParam
)
//
print(inMetalParam)
metalParam
=
inMetalParam
metalParam
=
inMetalParam
}
}
...
...
metal/paddle-mobile/paddle-mobile/Operators/Kernels/ConvBNReluKernel.swift
浏览文件 @
99342659
...
@@ -88,17 +88,16 @@ class ConvBNReluKernel<P: PrecisionType>: Kernel, Computable, Testable {
...
@@ -88,17 +88,16 @@ class ConvBNReluKernel<P: PrecisionType>: Kernel, Computable, Testable {
let
offsetX
=
param
.
filter
.
width
/
2
-
Int
(
param
.
paddings
[
0
])
let
offsetX
=
param
.
filter
.
width
/
2
-
Int
(
param
.
paddings
[
0
])
let
offsetY
=
param
.
filter
.
height
/
2
-
Int
(
param
.
paddings
[
1
])
let
offsetY
=
param
.
filter
.
height
/
2
-
Int
(
param
.
paddings
[
1
])
print
(
" param filter width:
\(
param
.
filter
.
width
)
"
)
//
print(" param filter width: \(param.filter.width)")
print
(
" param filter height:
\(
param
.
filter
.
height
)
"
)
//
print(" param filter height: \(param.filter.height)")
//
print
(
" param paddings:
\(
param
.
paddings
)
"
)
//
print(" param paddings: \(param.paddings)")
//
print
(
"ConvBNReluKernel offset x:
\(
offsetX
)
"
)
//
print("ConvBNReluKernel offset x: \(offsetX)")
print
(
"ConvBNReluKernel offset y:
\(
offsetY
)
"
)
//
print("ConvBNReluKernel offset y: \(offsetY)")
let
offsetZ
=
0.0
let
offsetZ
=
0.0
print
(
" fuck "
)
metalParam
=
MetalConvParam
.
init
(
offsetX
:
Int16
(
offsetX
),
offsetY
:
Int16
(
offsetY
),
offsetZ
:
Int16
(
offsetZ
),
strideX
:
UInt16
(
param
.
stride
[
0
]),
strideY
:
UInt16
(
param
.
stride
[
1
]),
dilationX
:
UInt16
(
param
.
dilations
[
0
]),
dilationY
:
UInt16
(
param
.
dilations
[
1
]))
metalParam
=
MetalConvParam
.
init
(
offsetX
:
Int16
(
offsetX
),
offsetY
:
Int16
(
offsetY
),
offsetZ
:
Int16
(
offsetZ
),
strideX
:
UInt16
(
param
.
stride
[
0
]),
strideY
:
UInt16
(
param
.
stride
[
1
]),
dilationX
:
UInt16
(
param
.
dilations
[
0
]),
dilationY
:
UInt16
(
param
.
dilations
[
1
]))
var
invs
:
[
P
]
=
[]
var
invs
:
[
P
]
=
[]
...
...
metal/paddle-mobile/paddle-mobile/Operators/Kernels/SoftmaxKernel.swift
浏览文件 @
99342659
...
@@ -43,7 +43,6 @@ class SoftmaxKernel<P: PrecisionType>: Kernel, Computable{
...
@@ -43,7 +43,6 @@ class SoftmaxKernel<P: PrecisionType>: Kernel, Computable{
}
}
encoder
.
setTexture
(
param
.
input
.
metalTexture
,
index
:
0
)
encoder
.
setTexture
(
param
.
input
.
metalTexture
,
index
:
0
)
encoder
.
setTexture
(
param
.
output
.
metalTexture
,
index
:
1
)
encoder
.
setTexture
(
param
.
output
.
metalTexture
,
index
:
1
)
encoder
.
setBytes
(
&
metalParam
,
length
:
MemoryLayout
<
SoftmaxMetalParam
>.
size
,
index
:
0
)
encoder
.
setBytes
(
&
metalParam
,
length
:
MemoryLayout
<
SoftmaxMetalParam
>.
size
,
index
:
0
)
encoder
.
dispatch
(
computePipline
:
pipline
,
outTexture
:
param
.
output
.
metalTexture
)
encoder
.
dispatch
(
computePipline
:
pipline
,
outTexture
:
param
.
output
.
metalTexture
)
encoder
.
endEncoding
()
encoder
.
endEncoding
()
...
...
metal/paddle-mobile/paddle-mobile/framework/Texture.swift
浏览文件 @
99342659
...
@@ -50,7 +50,7 @@ public class Texture<P: PrecisionType>: Tensorial {
...
@@ -50,7 +50,7 @@ public class Texture<P: PrecisionType>: Tensorial {
guard
padToFourDim
.
cout
()
==
4
else
{
guard
padToFourDim
.
cout
()
==
4
else
{
fatalError
(
"- not support -"
)
fatalError
(
"- not support -"
)
}
}
return
metalTexture
.
toTensor
(
dim
:
(
n
:
padToFourDim
[
0
],
c
:
padToFourDim
[
1
],
h
:
padToFourDim
[
2
],
w
:
padToFourDim
[
3
]))
return
metalTexture
.
toTensor
(
dim
:
(
n
:
dim
[
0
],
c
:
dim
[
3
],
h
:
dim
[
1
],
w
:
dim
[
2
]))
}
}
func
realNHWC
()
->
[
Float32
]
{
func
realNHWC
()
->
[
Float32
]
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录